Call this endpoint after shipment details are finalized to create a shipping label. The request is idempotent — repeating a request with the same idempotencyKey returns the original result without creating a duplicate label.
Use the id from the response to retrieve the label document (GET /labels/{id}) and track the shipment (GET /tracking/{id}).
Response codes: 201 Created — label created successfully · 200 OK — idempotent replay of a previously created label · 400 Bad Request — request validation failed · 404 Not Found — shipping account not found · 405 Method Not Allowed · 500 Internal Server Error · 502 Bad Gateway — courier service rejected the request.
Example notes: Replace unique-key-per-request with your own unique value on every call — reusing the same idempotencyKey triggers idempotent replay instead of creating a new label. Replace your-order-number with your actual platform order number, which must also be unique per shipment.
API access token issued by the Flex Forward team during onboarding.
Unique key to ensure idempotent label creation. Duplicate requests with the same key return the original result.
"ord-20250301-abc123"
Courier service identifier.
"yunexpress"
Idempotent replay — the label was already created for this idempotencyKey.
Unique label identifier.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
Label creation status — created or failed.
"created"
Courier service used.
"yunexpress"
Order number assigned by the courier, or null on failure.
"YT2503010001"
Tracking number assigned by the courier, or null if not yet available.
"YT2503010001CN"
Error details if the label creation failed, otherwise null.