Request
Write to a shipment by Convex ID:state accepts linked or unlinked.
Behavior
level: "shipment"stores the value inshipments.externalIds.tms_idand updates that shipment’sstatus.level: "order"stores the value inorders.externalIds.tms_idand updates all non-deleted shipments in that order to the requested status.- Order-level TMS IDs are not copied down to child shipment
externalIds. - The order overview can display the external ID column from either shipment-level or order-level values through the display menu.
Authentication
The route is public in the SvelteKit auth hook and authenticates itself with the WorkOS M2M bearer token. The server verifies issuer, audience, allowed client ID, required scope, and token organization before it writes to Convex. Required environment variables:| Variable | Purpose |
|---|---|
WORKOS_TMS_EXTERNAL_IDS_JWKS_URL | JWKS endpoint used to verify M2M JWT signatures. |
WORKOS_TMS_EXTERNAL_IDS_ISSUER | Expected token issuer. |
WORKOS_TMS_EXTERNAL_IDS_AUDIENCE | Expected token audience. |
WORKOS_TMS_EXTERNAL_IDS_ALLOWED_CLIENT_ID | Allowed WorkOS M2M client ID. |
WORKOS_TMS_EXTERNAL_IDS_REQUIRED_SCOPE | Required token scope. Defaults to tms:external_ids:write. |