OAuth Callback
GET/tiktok-shop/callback
Browser redirect target after the merchant authorizes the app on TikTok. Exchanges the auth code for access/refresh tokens, persists a TikTokShopIntegrationInstance, syncs authorized shops, subscribes webhooks, dispatches the initial product + recent-order backfill on the interactive queue (a background job + a background job), and redirects into the SPA. NOT a JSON endpoint.
The single registered callback URL lives on the central apex (app.sku.io), so the callback always lands there with no tenant header. Tenancy is restored from the tenant-prefixed state (<tenantId>_<uuid>), and the final redirect is built with TenantUrl::to so it targets the tenant's OWN subdomain (e.g. https://siber.sku.io/v2/integrations/tiktok-shop/\{id\}/dashboard) — loading the SPA in tenant context instead of forcing the central 'Choose an account' picker. On invalid/expired state it redirects to the tenant subdomain's /v2/integrations/tiktok-shop/new?error=... page.
No auth middleware — the cached state UUID is the security mechanism.
Request
Responses
- 302
- 401
- 403
- 429
Found
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.