Initialize OAuth
POST/api/temu/oauth/initialize
Starts a new Temu OAuth flow.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Generates a tenant-prefixed state so the OAuth callback (which lands on the central landlord domain with no tenant header) can recover tenancy from the state alone. Stores the chosen name + environment + integration_settings in a file cache for 1 hour so that POST /api/temu/oauth/complete can pick them back up after the merchant returns from Temu.
The returned authorization_url is where the frontend redirects/pops up the merchant to authorize SKU.io as a Temu app.
Request body (TemuInitializeIntegrationData):
name(string, required) — Display name for the new integration instance.environment(string, optional) — One ofsandboxorproduction. Honoured only on non-production servers; on prod theHasIntegrationEnvironmenttrait pins PRODUCTION regardless. Defaults tosandboxon non-prod,productionon prod.integration_settings(object, optional) — Free-form JSON persisted on the instance. Used by the inventory + sync modules.
Response data:
state(string) — Tenant-prefixed UUID. Round-trips through the OAuth callback and must be passed back tooauth/complete.authorization_url(string) — Full Temu authorization URL withappKey,redirect_uri, andstatequery params.
Authentication: Bearer token (Sanctum).
Throws: Exception when Temu app credentials for the selected environment are not configured (missing temu.<env>.app_key / app_secret).
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
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.
Unprocessable Entity
Response Headers
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.