OAuth Callback (Web)
GET//:domain/amazon/callback
Amazon Seller Central OAuth callback endpoint. Amazon redirects the user here after they grant or deny SP-API access in Seller Central. This endpoint is a web route (not under /api), is invoked by the user's browser (not by SKU.io frontend code), and accepts any HTTP method (Route::any).
Flow:
- Validates the presence of
spapi_oauth_codeandstatequery params (400 if missing). - Re-initializes tenancy from the
statevalue. - Loads the matching
AmazonIntegrationInstanceand exchanges the auth code for an access/refresh token via the Amazon SP-API connector. - Persists the authenticator +
selling_partner_idand marks the integration instancesync_status = ACTIVEandis_automatic_sync_enabled = true. - Performs initial setup calls when not in fake-OAuth mode: fetches marketplace participations, requests initial reports, processes FBA state, and dispatches the initial Financial Event Groups + Orders refresh jobs onto the
serialqueue. - Redirects the browser to
/integrations/amazon/{integrationInstanceId}/dashboard.
The response is a 302 redirect to the Vue 2/Vue 3 Amazon integration dashboard for the instance — there is no JSON payload.
Request
Responses
- 302
- 400
Found
Response Headers
Location
Bad Request