Skip to main content

Sandbox Initialize

POST 

/api/temu/sandbox/initialize

Creates a Temu sandbox integration instance without going through the OAuth flow.

Authorization

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

Created

Response Headers
    Content-Type