Module: Edi::Wayfair::CatalogApiTransport

Included in:
CatalogItemInformationRetriever, CatalogItemUpdateSender, TaxonomyAttributeRetriever
Defined in:
app/services/edi/wayfair/catalog_api_transport.rb

Overview

Shared builder for an authenticated transport to Wayfair's Catalog API.

Wayfair issues separate OAuth client credentials per supplier region
(usa / canada), and each client is authorized only for its own
supplier id — a US token querying the CA supplier (and vice versa) returns
PERMISSION_DENIED. This concern resolves the right country-scoped
credentials from the including service's orchestrator.partner so every
catalog caller (read, update, taxonomy) authenticates correctly.

Credentials live in credentials.yml.enc under
wayfair_catalog_api.{development,production}.{usa,canada} and are read via
Heatwave::Configuration.fetch(:wayfair_catalog_api, :usa|:canada) (the
environment level is inserted automatically).

Examples:

class Edi::Wayfair::SomeCatalogService < Edi::BaseEdiService
  include Edi::Wayfair::CatalogApiTransport
end

Constant Summary collapse

CATALOG_API_BASE =

Base host used to mint the OAuth audience (the per-operation GraphQL
endpoint path is supplied separately by each service's catalog_api_url).

'https://api.wayfair.io'
CATALOG_AUTH_URL =

OAuth2 client-credentials token endpoint.

'https://sso.auth.wayfair.com/oauth/token'