Order

Create a new order if it does not already exist. Duplicate orders return a validation error. For idempotent create-or-update behavior, use the PUT endpoint.

Payload validation:

  • Request-blocking validation failures return HTTP 400 and no order or mutation history is written. Serializer and Pydantic validation errors use the standard {"type": "client_error", "errors": [...]} shape. Early order identifier and account authorization failures return {"detail": "..."}.
  • recipient_email must be a valid email address or the literal _unset.
  • Country, language, currency, timezone, enum, date, datetime, decimal, length, and required-field validations are enforced at the request boundary.
  • shipping_address and tracking-level shipping_address are strictly validated, including region codes. billing_address uses the more permissive address schema and can coerce invalid region codes to null.
  • Mutation payloads must use a supported type. Tracking mutations require either tracking_number plus courier, or external_reference.
  • Tracking-level delivery_method must be configured for the account.
  • add_tracking with tracking_number plus courier performs a best-effort same-account conflict check before enqueueing. The check is eventually consistent and Backend persistence still enforces downstream uniqueness.

Successful responses can still contain per-mutation validation information:

  • Non-fatal validation warnings are returned in mutations[].result.warnings. Today this covers dropped unrecognized add_tracking.tracking fields and articles_order replacement warnings when mutations are present.
  • Accepted mutation failures do not reject the whole request. The HTTP response remains 200 or 201, while the affected mutation returns mutations[].result.success=false.
post/v4/track/orders/

Request

  • The document declares no server URL.
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Request body

accountinteger required

Account to which this order belongs

order_numberstring required

Order number (customer facing)

external_referencestring

Retailer reference (e.g. internal system ID) for this order, unique.

client_keystring

Name of the technical client / shop (corresponds to the system setup), e.g. 'mybrand-a.com'

destination_country_iso3string required

Destination country ISO 3166-1 alpha 3 code

language_iso2string

ISO 639-1 language code of the recipient, if known, required for localized communication

delivery_methodstring

Delivery method (e.g. 'standard shipping'), needs to be set up in the system

recipient_namestring

Recipient name

customer_numberstring

Customer number (e.g. from the retailer)

invoice_numberstring

Invoice number (e.g. from the retailer)

payment_methodstring

Payment method (e.g. 'credit card')

order_total_amountstring decimal nullable

Total amount of the order (usually after tax & discount)

order_tax_amountstring decimal nullable

Tax amount of the original order

order_net_amountstring decimal nullable

Net amount of the order (usually before tax)

order_discount_amountstring decimal nullable

Discount amount of the order

order_currencystring

Currency of the order, e.g. USD, EUR (ISO 4217)

paymentsobject[]
order_datestring date-time nullable

Date and time when the order was placed

channelstring

Channel through which the order was placed (e.g. 'webshop')

announced_delivery_datestring date nullable

Announced delivery date

announced_delivery_date_minstring date nullable

Announced delivery date range of order (min)

announced_delivery_date_maxstring date nullable

Announced delivery date range of order (min)

timezonestring

Timezone of the recipient, if known, not required, but strongly recommended

order_statusstring

Current status of the order, as setup in the system

has_multiple_shipmentsboolean nullable

Indicates this order has been split into multiple shipments

cancelled_datestring date-time nullable

Datetime when the order was cancelled

cancelled_reason'customer' | 'inventory' | 'payment' | 'other'
  • customer - Customer
  • inventory - Inventory
  • payment - Payment-related
  • other - Other
tagsstring[]

Tags for the object, format <key>:<value>e.g. 'category:Home Apparel'

Example request

{
  "articles_order": [
    {
      "article_name": "Blue T-Shirt",
      "line_item_id": "ITEM-001",
      "product_id": "PROD-123",
      "quantity": 2,
      "sku": "TSHIRT-BLUE-M"
    }
  ],
  "mutations": [
    {
      "tracking": {
        "articles": [
          {
            "article_name": "Blue T-Shirt",
            "line_item_id": "ITEM-001",
            "product_id": "PROD-123",
            "quantity": 2,
            "sku": "TSHIRT-BLUE-M"
          }
        ]
      }
    }
  ]
}

Response

Order payload. Mutation actions include mutations[].result. Non-fatal validation warnings are returned in mutations[].result.warnings; accepted mutation failures are returned as mutations[].result.success=false.

accountinteger required

Account to which this order belongs

order_numberstring required

Order number (customer facing)

external_idstring required

Unique identifier for this order, generated by parcelLab for this order

external_referencestring

Retailer reference (e.g. internal system ID) for this order, unique.

client_keystring

Name of the technical client / shop (corresponds to the system setup), e.g. 'mybrand-a.com'

destination_country_iso3string required

Destination country ISO 3166-1 alpha 3 code

language_iso2string

ISO 639-1 language code of the recipient, if known, required for localized communication

delivery_methodstring

Delivery method (e.g. 'standard shipping'), needs to be set up in the system

recipient_namestring

Recipient name

customer_numberstring

Customer number (e.g. from the retailer)

invoice_numberstring

Invoice number (e.g. from the retailer)

payment_methodstring

Payment method (e.g. 'credit card')

order_total_amountstring decimal nullable

Total amount of the order (usually after tax & discount)

order_tax_amountstring decimal nullable

Tax amount of the original order

order_net_amountstring decimal nullable

Net amount of the order (usually before tax)

order_discount_amountstring decimal nullable

Discount amount of the order

order_currencystring

Currency of the order, e.g. USD, EUR (ISO 4217)

paymentsobject[]
order_datestring date-time nullable

Date and time when the order was placed

channelstring

Channel through which the order was placed (e.g. 'webshop')

announced_delivery_datestring date nullable

Announced delivery date

announced_delivery_date_minstring date nullable

Announced delivery date range of order (min)

announced_delivery_date_maxstring date nullable

Announced delivery date range of order (min)

timezonestring

Timezone of the recipient, if known, not required, but strongly recommended

order_statusstring

Current status of the order, as setup in the system

has_multiple_shipmentsboolean nullable

Indicates this order has been split into multiple shipments

cancelled_datestring date-time nullable

Datetime when the order was cancelled

cancelled_reason'customer' | 'inventory' | 'payment' | 'other'
  • customer - Customer
  • inventory - Inventory
  • payment - Payment-related
  • other - Other
tagsstring[]

Tags for the object, format <key>:<value>e.g. 'category:Home Apparel'

Example response

{
  "articles_order": [
    {
      "article_name": "Blue T-Shirt",
      "line_item_id": "ITEM-001",
      "product_id": "PROD-123",
      "quantity": 2,
      "sku": "TSHIRT-BLUE-M"
    }
  ],
  "mutations": [
    {
      "tracking": {
        "articles": [
          {
            "article_name": "Blue T-Shirt",
            "line_item_id": "ITEM-001",
            "product_id": "PROD-123",
            "quantity": 2,
            "sku": "TSHIRT-BLUE-M"
          }
        ]
      }
    }
  ]
}

Changes