Skip to main content
POST
Create a shipping label

Authorizations

x-rr-apikey
string
header
required
x-rr-apitoken
string
header
required

Body

application/json

Request payload for creating a shipping label.

Request payload for creating a shipping label.

idempotencyKey
string
required

Client-generated unique key to ensure idempotent label creation. Replaying a request with the same key returns the original result.

Required string length: 1 - 100
Example:

"unique-key-per-request"

courier
string
required

Courier code to use. Call GET /couriers to list valid courier codes available to your account, then pass one of the returned code values.

Minimum string length: 1
Example:

"yunexpress"

service
object
required

Courier service configuration.

shipment
object
required

Shipment details including origin, destination, and parcels.

label
object

Label output preferences.

units
object

Measurement units for weight and dimensions.

order
object

Order reference information.

customs
object

Customs declaration information for cross-border shipments.

serviceOptions
object[]

Additional service options as code-value pairs.

dangerousGoods
object

Dangerous goods declaration.

pickup
object

Pickup point configuration.

courierOptions
object

Courier-specific options.

Response

Idempotent replay. The idempotencyKey was already used with the same request body, so the stored result of the first attempt is returned and the courier is not contacted again. The body may have status "failed" if the first attempt was rejected by the courier — branch on the status field, not on the HTTP code. If the idempotencyKey was already used with a different request body, this returns 409 IDEMPOTENCY_CONFLICT instead.

Result of a label creation attempt. Returned on 201 (created), 502 (courier rejected) and 200 (idempotent replay of either).

id
string<uuid>
required

Unique label identifier.

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

status
enum<string>
required

Label creation outcome. created means the courier issued the label; failed means the courier rejected it and the attempt was stored. On an idempotent replay (HTTP 200) this field, not the HTTP status, tells you the outcome.

Available options:
created,
failed
Example:

"created"

courier
string
required

Courier service used.

Example:

"yunexpress"

customerOrderNumber
string
required

Customer order number for this label: the value supplied in order.customerOrderNumber, or a system-generated value when none was supplied. Unique per account.

Example:

"N-2026-05-27-TEST-03"

courierOrderNumber
string | null
required

Order number assigned by the courier, or null on failure.

Example:

"YT2503010001"

courierTrackingNumber
string | null
required

Tracking number assigned by the courier, or null if not yet available.

Example:

"LMTN2503010001XY"

error
object | null
required

Courier error details when status is failed; always null when status is created.