Sandbox Initialize
POST/api/temu/sandbox/initialize
Creates a Temu sandbox integration instance without going through the OAuth flow.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Temu's sandbox has no OAuth — the merchant is issued a static long-lived access token through the developer portal. SKU.io reads that token (plus the sandbox app_key and app_secret) from env / Secrets Manager via the temu.sandbox.* config keys and persists it on the new instance at creation time. The instance is created with environment = sandbox, its API base URL pinned to temu.sandbox.api_url, and the access token serialised onto the authenticator column.
After creation, the same initial sync jobs (warehouses, carriers, categories, products, orders) are dispatched as for the production OAuth flow.
Refuses to run on a production server — even if the call somehow arrived there, the HasIntegrationEnvironment trait would coerce the runtime env to PRODUCTION and the saved sandbox row would be misleading.
Request body (TemuInitializeIntegrationData):
name(string, required) — Display name for the sandbox instance. If another instance with this exact name already exists,(N+1)is appended.integration_settings(object, optional) — Free-form JSON persisted on the instance.environment(string, optional) — Accepted but ignored — sandbox is forced.
Response: A 201 Created with the newly-persisted TemuIntegrationInstance resource and a message.
Authentication: Bearer token (Sanctum).
Throws: Exception when called on a production server, or when TEMU_SANDBOX_APP_KEY / TEMU_SANDBOX_APP_SECRET / TEMU_SANDBOX_ACCESS_TOKEN are not configured.
Request
Responses
- 201
- 401
- 403
- 422
- 429
- 500
Created
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.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
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.
Internal Server Error