Skip to main content
POST
/
labels
Create a shipping label
curl --request POST \
  --url https://api.flexforwardship.com/labels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotencyKey": "unique-key-per-request",
  "courier": "yunexpress",
  "service": {
    "productCode": "HKMUZXR"
  },
  "label": {
    "format": "PDF"
  },
  "units": {
    "weight": "KG",
    "dimension": "CM"
  },
  "order": {
    "customerOrderNumber": "N-2026-05-27-TEST-03",
    "orderNumbers": {
      "platformOrderNumber": "platform-order-number",
      "referenceNumbers": [
        "ref-number-1",
        "ref-number-2"
      ]
    }
  },
  "shipment": {
    "shipTo": {
      "contact": {
        "firstName": "Alex",
        "lastName": "Smith",
        "phone": 8554377467,
        "email": "[email protected]"
      },
      "address": {
        "streetLines": [
          "18 Distribution Blvd"
        ],
        "city": "Edison",
        "state": "New jersey",
        "postalCode": 8817,
        "countryCode": "US"
      }
    },
    "shipFrom": {
      "contact": {
        "firstName": "John",
        "lastName": "Doe",
        "phone": 886900676877,
        "email": "[email protected]"
      },
      "address": {
        "streetLines": [
          "Habucho"
        ],
        "city": "Kishiwada-Shi",
        "state": "Osaka",
        "postalCode": "596-0825",
        "countryCode": "JP"
      }
    },
    "parcels": [
      {
        "weight": 0.5,
        "dimension": {
          "length": 30,
          "width": 20,
          "height": 10
        },
        "items": [
          {
            "descriptionEn": "Muji Ink pen",
            "descriptionLocal": "文具",
            "quantity": 1,
            "unitPrice": {
              "amount": 29.99,
              "currency": "USD"
            },
            "unitWeight": 0.5
          }
        ]
      }
    ]
  },
  "serviceOptions": [
    {
      "code": "V1",
      "value": "云途预缴"
    }
  ],
  "courierOptions": {
    "yunexpress": {
      "sourceCode": "YT",
      "sensitiveType": "D"
    }
  }
}
'
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "status": "created",
  "courier": "yunexpress",
  "customerOrderNumber": "N-2026-05-27-TEST-03",
  "courierOrderNumber": "YT2503010001",
  "courierTrackingNumber": "YT2503010001CN",
  "error": {
    "code": "<string>",
    "message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

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

Result of a label creation request.

Result of a label creation request.

id
string<uuid>
required

Unique label identifier.

Example:

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

status
required

Label creation outcome — created or failed.

Available options:
created
Example:

"created"

courier
string
required

Courier service used.

Example:

"yunexpress"

customerOrderNumber
string
required

Customer order number associated with this label.

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:

"YT2503010001CN"

error
object | null
required

Error details if the label creation failed, otherwise null.