Create a shipping label

​

Creates the shipping label of one of your sales with the service you chose from GET /v1/sales/{orderNumber}/shipping-options. The service is checked against the ones available now, the carrier creates the parcel, the tracking number is registered, and the label is stored on the sale. A destination that needs customs documents also gets a customs form.

You are not charged for the label. The sale stays pending_shipment and becomes shipped at the carrier's first scan. The label file is not returned: open webUrl and print it from the order page, or fetch it with GET /v1/sales/{orderNumber}/shipping-label/documents/{kind}.

A sale has one label. The order is claimed before the carrier is contacted, so two requests at the same moment buy one label: the second gets 409 LABEL_IN_PROGRESS, and a sale that already has a label returns 409 LABEL_ALREADY_EXISTS with its tracking number. If a step after the carrier created the parcel fails, the label is cancelled.

Each label costs real money, so labels have a low rate limit (shipping-labels) shared by all your keys.

Send an Idempotency-Key header to make retries safe: the same key returns the same response for 24 hours.

Requires the sales:write scope.

Path Parameters

  • The order reference, e.g. OR-MWRDE-2. Path parameter — not a query string.

Body

required
application/json
  • The service to ship with: a methodId from GET /v1/sales/{orderNumber}/shipping-options. It is checked again against the services available now.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/sales/{orderNumber}/shipping-label
curl 'https://public-api.cardnexus.com/v1/sales/{orderNumber}/shipping-label' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "methodId": ""
}'
{
  "orderNumber": "OR-MWRDE-2",
  "trackingNumber": "6A12345678901",
  "carrier": "Colissimo",
  "service": "Colissimo Home",
  "documentKind": "label",
  "customsDocument": false,
  "webUrl": "https://cardnexus.com/orders/OR-MWRDE-2"
}