Skip to main content
POST
/
labels
Create a shipping label
curl --request POST \
  --url https://api.flexforward.com/labels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotencyKey": "ord-20250301-abc123",
  "courier": "yunexpress",
  "service": {
    "shipperAccountId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "productCode": "YEXP01"
  },
  "shipment": {
    "shipTo": {
      "contact": {
        "firstName": "John",
        "lastName": "Doe",
        "phone": "+81-90-1234-5678"
      },
      "address": {
        "countryCode": "JP",
        "city": "Tokyo",
        "postalCode": "100-0001",
        "streetLines": [
          "1-1 Marunouchi"
        ]
      }
    },
    "parcels": [
      {
        "weight": 0.5,
        "items": [
          {
            "descriptionEn": "Wireless earbuds",
            "quantity": 1,
            "unitPrice": {
              "amount": 29.99,
              "currency": "USD"
            },
            "unitWeight": 0.5
          }
        ]
      }
    ]
  }
}
'
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "status": "created",
  "courier": "yunexpress",
  "courierOrderNumber": "YT2503010001",
  "courierTrackingNumber": "YT2503010001CN",
  "error": {
    "code": "COURIER_ERROR",
    "message": "YunExpress API returned HTTP 400: Bad request"
  }
}

Authorizations

Authorization
string
header
required

API access token obtained from the Flex Forward dashboard.

Body

application/json
idempotencyKey
string
required

Unique key to ensure idempotent label creation. Duplicate requests with the same key return the original result.

Example:

"ord-20250301-abc123"

courier
string
required

Courier service identifier.

Example:

"yunexpress"

service
object
required
shipment
object
required
label
object
units
object
order
object
customs
object
serviceOptions
object[]
dangerousGoods
object
pickup
object
courierOptions
object

Response

Idempotent replay — the label was already created for this idempotencyKey.

id
string<uuid>
required

Unique label identifier.

Example:

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

status
string
required

Label creation status — created or failed.

Example:

"created"

courier
string
required

Courier service used.

Example:

"yunexpress"

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
required

Error details if the label creation failed, otherwise null.