Prerequisites
Before you start, make sure you have:- Session token: A valid session token. See the Authentication guide to learn how to obtain one.
- Seller ID: Use the
GET /sellers endpointto find it. - Shipping service group ID: Use the
GET /shippingServiceGroups/{sellerId} endpointto find available shipping service groups.
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 thePOST /shipments/estimate endpoint. Use the requestUUID field to match the estimate results to your requests.
- Request
- Response
Use this request to estimate shipment costs:
Book a shipment
Book a shipment label using thePOST /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:
- Request
- Response
Use this request to book a shipment label:
Request fields
The following table describes the key fields you can include when booking a shipment. TheshipTo and shipFrom objects use the ShipmentDeliveryAddress schema. For complete field definitions, see the API Reference:
| Field | Type | Description |
|---|---|---|
sellerId | Integer | The seller who is booking this shipment. |
shippingServiceGroupId | Integer | Shipping service group from which to load the shipping services to use. |
grossWeightKg | Number | The total weight (kilograms) of the shipment including packaging. Must be greater than 0. |
shipTo | Object | Delivery address object. See address fields below. |
shipFrom | Object | Sender address object. Optional. |
reference | String | A human readable reference for the request. Optional. If not included, the system generates a random reference. |
requestUUID | String | A unique identifier for the request. Used for tracing and to prevent duplicate shipment bookings. Optional. If not included, the system generates a random requestUUID. |
lengthM | Number | Optional length in meters of the shipment. Must be greater than 0. |
widthM | Number | Optional width in meters of the shipment. Must be greater than 0. |
heightM | Number | Optional height in meters of the shipment. Must be greater than 0. |
trackingEnabled | Boolean | Optional value setting whether to turn on/off tracking for shipment. Additional charges apply when set to true. |
includeReturnLabel | Boolean | Optional value setting whether to include a return label along with the main label. |
shipmentDate | String (date) | Optional future or today’s date when the carrier picks up the shipment. If not specified, defaults to today. |
termsOfTrade | String | Optional terms of trade. If not specified, defaults to DAP. Valid values: DAP, DDP. |
customsPositions | Array | Optional customs positions for the shipment. Only required if shipping to countries that require export documents. |
invoiceNumber | String | The invoice number for customs declaration. |
invoiceDate | String (date) | The invoice date for customs declaration. |
transportInsuranceAmount | Number | Optional amount to insure when booking the shipment. Setting this field to a non-null value books additional insurance. |
shipTo.name / shipFrom.name | String | Name of the recipient. Usually the first and last name. You must provide either name or company. |
shipTo.company / shipFrom.company | String | Name of the company. You must provide either name or company. |
shipTo.email / shipFrom.email | String | Email address of the recipient. |
shipTo.phone / shipFrom.phone | String | Phone number of the recipient. |
shipTo.street / shipFrom.street | String | Street address (Address Line 1). Optional only when you provide latitude and longitude coordinates. |
shipTo.street2 / shipFrom.street2 | String | Address Line 2. Optional. |
shipTo.city / shipFrom.city | String | City. Optional only when you provide latitude and longitude coordinates. |
shipTo.zip / shipFrom.zip | String | ZIP or postal code. Optional for some countries, but required for most. Optional when you provide latitude and longitude coordinates. |
shipTo.state / shipFrom.state | String | State or province. Required for some countries (for example, United States). |
shipTo.countryIso2 / shipFrom.countryIso2 | String | Two-letter ISO country code. Optional only when you provide latitude and longitude coordinates. |
shipTo.latitude / shipFrom.latitude | Number | Latitude coordinate for the address. Optional, used for some carriers to optimize the delivery process. |
shipTo.longitude / shipFrom.longitude | Number | Longitude 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 theGET /shipments/{bookedShipmentId} endpoint to get details by shipment ID:
- Request
- Response
Use this request to retrieve the full details of a booked shipment by its ID:
Retrieve shipping labels
You can retrieve shipping labels in two ways:- From the booking response: The
labelUrlsarray in theBookResponsecontains URLs where you can download the shipping labels. - From shipment details: Retrieve shipment details using the
GET /shipments/{bookedShipmentId}endpoint. The response includes adocumentsarray with document information. Use theshipmentDocumentIdfrom each document to retrieve the download URL using theGET /shipments/documentLinkendpoint.
GET /shipments/documentLink endpoint:
- Request
- Response
Use this request to get a download link for a shipment document:
Track shipment status
Search for booked shipments using theGET /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.
- Request
- Response
Use this request to search for shipments using query parameters:
GET /shipments/{bookedShipmentId} endpoint. The response includes a trackingDetails array with tracking information.
Schedule a pickup
Book a pickup for booked shipments using thePOST /shipments/pickups endpoint. You must provide the seller ID, shipping service group ID, parcel count, and pickup date. The pickupFrom address is optional.
- Request
- Response
Use this request to book a pickup:
Search for booked pickups
Search for booked pickups using theGET /shipments/pickups endpoint. Use the query parameter to filter results by pickup date, seller, or other criteria.
- Request
- Response
Use this request to search for booked pickups:
Batch operations
Book a batch of shipment labels using thePOST /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.
- Request
- Response
Use this request to book a batch of shipments:
Cancel a shipment
Cancel a booked shipment using theDELETE /shipments/{bookedShipmentId} endpoint:
- Request
- Response
Use this request to cancel a booked shipment:
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.