Amazon SP-API
Purpose
Orders, catalog, inventory feeds, and settlements for channel type AMAZON.
Authentication
LWA refresh token in the vault. App-level SP-API client id and secret in env. Region and marketplace id are required once the client id is set.
Authorize URL and callback routes live on amazon.controller.ts. The callback that stores Seller Central authorization is JWT-protected in the inventory that was read, not @PublicRoute.
Direction
No dedicated Amazon webhook controller was found. Orders are pulled. Inventory uses an async feed: submit, persist ChannelInventoryFeedSubmission, poll with channel-feed-poll. ChannelInventoryState updates when the poll result is read.
Flush job: flush-channel:AMAZON.
Settlements: sync job type settlement, file parsers, and POST .../settlements/sync with SETTLEMENT:CREATE.
Fulfillment mode
Schema comment: Amazon AFN versus MFN is per order. Channel defaultFulfillmentMode defaults to OMS_MANAGED and is a fallback.
Unknown: whether AFN orders skip pick and pack, and where that branch is.
Code
src/integrations/amazon.
Failure
Feed polls that stick are requeued every 10 minutes by ChannelFeedPollReaperScheduler. Sync failures use the shared circuit breaker.
Idempotency
Feed submission ids are stored. Order natural keys were not fully traced.