Skip to main content

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

Found

Response Headers
    Location