Skip to main content
This guide shows you how to manually book shipments, retrieve shipping labels, track shipment status, schedule pickups, perform batch operations, and estimate shipment costs.

Prerequisites

Before you start, make sure you have:
All API examples in this guide use ${BASE_URL} as a placeholder. Replace it with the correct base URL configured for the correct environment. For more information see Environments page.

Estimate shipment costs

Estimate the price of shipment labels before booking using the POST /shipments/estimate endpoint. Use the requestUUID field to match the estimate results to your requests.
Use this request to estimate shipment costs:
curl -X POST "${BASE_URL}/shipments/estimate" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "estimateRequests": [
      {
        "sellerId": <YOUR_SELLER_ID>,
        "shippingServiceGroupId": <SHIPPING_SERVICE_GROUP_ID>,
        "grossWeightKg": <WEIGHT_KG>,
        "shipTo": {
          "name": "<RECIPIENT_NAME>",
          "street": "<STREET_ADDRESS>",
          "city": "<CITY>",
          "zip": "<ZIP_CODE>",
          "countryIso2": "<COUNTRY_CODE>"
        },
        "requestUUID": "<REQUEST_UUID>"
      }
    ]
  }'

Book a shipment

Book a shipment label using the POST /shipments/book endpoint. You must provide the seller ID, shipping service group ID, gross weight, and delivery address. The shipFrom address is optional. The following example shows how to book a shipment:
Use this request to book a shipment label:
curl -X POST "${BASE_URL}/shipments/book" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "sellerId": <YOUR_SELLER_ID>,
    "shippingServiceGroupId": <SHIPPING_SERVICE_GROUP_ID>,
    "grossWeightKg": <WEIGHT_KG>,
    "shipTo": {
      "name": "<RECIPIENT_NAME>",
      "company": "<COMPANY_NAME>",
      "email": "<RECIPIENT_EMAIL>",
      "phone": "<RECIPIENT_PHONE>",
      "street": "<STREET_ADDRESS>",
      "street2": "<ADDRESS_LINE_2>",
      "city": "<CITY>",
      "zip": "<ZIP_CODE>",
      "state": "<STATE>",
      "countryIso2": "<COUNTRY_CODE>"
    },
    "shipFrom": {
      "name": "<SENDER_NAME>",
      "street": "<SENDER_STREET>",
      "city": "<SENDER_CITY>",
      "zip": "<SENDER_ZIP>",
      "countryIso2": "<SENDER_COUNTRY_CODE>"
    },
    "reference": "<REFERENCE>",
    "requestUUID": "<REQUEST_UUID>",
    "lengthM": <LENGTH_M>,
    "widthM": <WIDTH_M>,
    "heightM": <HEIGHT_M>,
    "trackingEnabled": true
  }'

Request fields

The following table describes the key fields you can include when booking a shipment. The shipTo and shipFrom objects use the ShipmentDeliveryAddress schema. For complete field definitions, see the API Reference:
FieldTypeDescription
sellerIdIntegerThe seller who is booking this shipment.
shippingServiceGroupIdIntegerShipping service group from which to load the shipping services to use.
grossWeightKgNumberThe total weight (kilograms) of the shipment including packaging. Must be greater than 0.
shipToObjectDelivery address object. See address fields below.
shipFromObjectSender address object. Optional.
referenceStringA human readable reference for the request. Optional. If not included, the system generates a random reference.
requestUUIDStringA unique identifier for the request. Used for tracing and to prevent duplicate shipment bookings. Optional. If not included, the system generates a random requestUUID.
lengthMNumberOptional length in meters of the shipment. Must be greater than 0.
widthMNumberOptional width in meters of the shipment. Must be greater than 0.
heightMNumberOptional height in meters of the shipment. Must be greater than 0.
trackingEnabledBooleanOptional value setting whether to turn on/off tracking for shipment. Additional charges apply when set to true.
includeReturnLabelBooleanOptional value setting whether to include a return label along with the main label.
shipmentDateString (date)Optional future or today’s date when the carrier picks up the shipment. If not specified, defaults to today.
termsOfTradeStringOptional terms of trade. If not specified, defaults to DAP. Valid values: DAP, DDP.
customsPositionsArrayOptional customs positions for the shipment. Only required if shipping to countries that require export documents.
invoiceNumberStringThe invoice number for customs declaration.
invoiceDateString (date)The invoice date for customs declaration.
transportInsuranceAmountNumberOptional amount to insure when booking the shipment. Setting this field to a non-null value books additional insurance.
shipTo.name / shipFrom.nameStringName of the recipient. Usually the first and last name. You must provide either name or company.
shipTo.company / shipFrom.companyStringName of the company. You must provide either name or company.
shipTo.email / shipFrom.emailStringEmail address of the recipient.
shipTo.phone / shipFrom.phoneStringPhone number of the recipient.
shipTo.street / shipFrom.streetStringStreet address (Address Line 1). Optional only when you provide latitude and longitude coordinates.
shipTo.street2 / shipFrom.street2StringAddress Line 2. Optional.
shipTo.city / shipFrom.cityStringCity. Optional only when you provide latitude and longitude coordinates.
shipTo.zip / shipFrom.zipStringZIP or postal code. Optional for some countries, but required for most. Optional when you provide latitude and longitude coordinates.
shipTo.state / shipFrom.stateStringState or province. Required for some countries (for example, United States).
shipTo.countryIso2 / shipFrom.countryIso2StringTwo-letter ISO country code. Optional only when you provide latitude and longitude coordinates.
shipTo.latitude / shipFrom.latitudeNumberLatitude coordinate for the address. Optional, used for some carriers to optimize the delivery process.
shipTo.longitude / shipFrom.longitudeNumberLongitude coordinate for the address. Optional, used for some carriers to optimize the delivery process.

Retrieve shipment details

Retrieve shipment details using the booked shipment ID. Use the GET /shipments/{bookedShipmentId} endpoint to get details by shipment ID:
Use this request to retrieve the full details of a booked shipment by its ID:
curl -X GET "${BASE_URL}/shipments/<BOOKED_SHIPMENT_ID>" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>"

Retrieve shipping labels

You can retrieve shipping labels in two ways:
  1. From the booking response: The labelUrls array in the BookResponse contains URLs where you can download the shipping labels.
  2. From shipment details: Retrieve shipment details using the GET /shipments/{bookedShipmentId} endpoint. The response includes a documents array with document information. Use the shipmentDocumentId from each document to retrieve the download URL using the GET /shipments/documentLink endpoint.
To get a download link for a specific document, use the GET /shipments/documentLink endpoint:
Use this request to get a download link for a shipment document:
curl -X GET "${BASE_URL}/shipments/documentLink?shipmentDocumentId=<DOCUMENT_ID>" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>"

Track shipment status

Search for booked shipments using the GET /shipments endpoint. This endpoint supports query, sorting, and pagination parameters. Use the query parameter to filter results, sort to order them, and pageSize to limit the number of results.
Use this request to search for shipments using query parameters:
curl -X GET "${BASE_URL}/shipments?query=trackingNumber:<TRACKING_NUMBER>&sort=created:desc&pageSize=50" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>"
For detailed tracking information, retrieve the full shipment details using the GET /shipments/{bookedShipmentId} endpoint. The response includes a trackingDetails array with tracking information.

Schedule a pickup

Book a pickup for booked shipments using the POST /shipments/pickups endpoint. You must provide the seller ID, shipping service group ID, parcel count, and pickup date. The pickupFrom address is optional.
Use this request to book a pickup:
curl -X POST "${BASE_URL}/shipments/pickups" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "sellerId": <YOUR_SELLER_ID>,
    "shippingServiceGroupId": <SHIPPING_SERVICE_GROUP_ID>,
    "parcelCount": <PARCEL_COUNT>,
    "pickupDate": "<PICKUP_DATE>",
    "pickupFrom": {
      "name": "<PICKUP_CONTACT_NAME>",
      "street": "<PICKUP_STREET_ADDRESS>",
      "city": "<PICKUP_CITY>",
      "zip": "<PICKUP_ZIP>",
      "countryIso2": "<PICKUP_COUNTRY_CODE>",
      "phone": "<PICKUP_PHONE>"
    }
  }'

Search for booked pickups

Search for booked pickups using the GET /shipments/pickups endpoint. Use the query parameter to filter results by pickup date, seller, or other criteria.
Use this request to search for booked pickups:
curl -X GET "${BASE_URL}/shipments/pickups?query=pickupDate:<PICKUP_DATE>&sort=created:desc&pageSize=50" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>"

Batch operations

Book a batch of shipment labels using the POST /shipments/bookBatchAsync endpoint. This endpoint processes multiple shipment bookings asynchronously and sends the results via email. The lineNumber field represents the line number in the original batch file. Once the batch operation completes, the system sends a ZIP file with labels and export documents to the specified email address.
Use this request to book a batch of shipments:
curl -X POST "${BASE_URL}/shipments/bookBatchAsync" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "<BATCH_REFERENCE>",
    "email": "<EMAIL_ADDRESS>",
    "bookRequests": [
      {
        "lineNumber": <LINE_NUMBER>,
        "sellerId": <YOUR_SELLER_ID>,
        "shippingServiceGroupId": <SHIPPING_SERVICE_GROUP_ID>,
        "grossWeightKg": <WEIGHT_KG>,
        "shipTo": {
          "name": "<RECIPIENT_NAME_1>",
          "street": "<STREET_ADDRESS_1>",
          "city": "<CITY_1>",
          "zip": "<ZIP_CODE_1>",
          "countryIso2": "<COUNTRY_CODE_1>"
        },
        "reference": "<ORDER_REFERENCE>"
      },
      {
        "lineNumber": <LINE_NUMBER>,
        "sellerId": <YOUR_SELLER_ID>,
        "shippingServiceGroupId": <SHIPPING_SERVICE_GROUP_ID>,
        "grossWeightKg": <WEIGHT_KG>,
        "shipTo": {
          "name": "<RECIPIENT_NAME_2>",
          "street": "<STREET_ADDRESS_2>",
          "city": "<CITY_2>",
          "zip": "<ZIP_CODE_2>",
          "countryIso2": "<COUNTRY_CODE_2>"
        },
        "reference": "<ORDER_REFERENCE>"
      }
    ]
  }'

Cancel a shipment

Cancel a booked shipment using the DELETE /shipments/{bookedShipmentId} endpoint:
Use this request to cancel a booked shipment:
curl -X DELETE "${BASE_URL}/shipments/<BOOKED_SHIPMENT_ID>" \
  -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
  -H "Authorization: <YOUR_SESSION_TOKEN>"

Where to go next

Now that you can manage shipments, continue with these guides:

Track an Order

Monitor order status and retrieve tracking information when shipping occurs.

Manage Returns

Generate return labels and track returned items when customers need to send products back.