Create a parcel
Creating a parcel registers a package with us: where it is collected, where it goes, who to contact at each end, and what it looks like physically.
Creating does not shipA created parcel sits in the
readystate and nothing is collected. To have it picked up you must then request its shipment. See Parcels life cycle for the states that follow.
See Parcel for what the entity holds.
Request
curl --request POST \
--url https://logistics.api.{{BASE_ENV_URL}}/v1/parcels \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
"parcels": [
{
"external_id": "order_1042",
"pickup_info": {
"loc": { "lat": 40.456367, "lon": -3.690587 },
"addr": "Calle de Pradillo, 42, Madrid",
"instr": "Ask for the shift manager",
"contact": { "name": "Magic Store", "phone": "+34600000000" }
},
"dropoff_info": {
"addr": "Gran Via 1, Madrid",
"contact": { "name": "Ada Lovelace", "phone": "+34600000001" }
},
"dimensions": { "height": 10, "length": 20, "width": 15, "unit": "cm" },
"weight": { "value": 1500, "unit": "g" }
}
]
}'You may create several parcels in one call: parcels is an array.
Locating the pickup and the dropoff
Both pickup_info and dropoff_info require at least one of:
loc— coordinates, as{ "lat": ..., "lon": ... }.addr— a human-readable address.hub_external_id— the external ID of a hub you have registered.
They can be combined. When loc is present the coordinates are used and addr is kept as informational only, so a precise loc with a friendly addr is the safest combination.
contact is required on both ends; the recipient's name is always needed.
Optional fields worth knowing
| Field | What it is for |
|---|---|
external_id | Your own reference. Must be unique across your parcels — reusing one fails with 409. |
delivery_from / delivery_to | The requested delivery window, RFC 3339. |
price | Declared value of the contents and any amount to collect on delivery. |
pickup_info.code | A short code the driver is shown to confirm the pickup. Only use it when the delivery is a single parcel: one code is shown per delivery. |
Response
200 returns the created parcels, each with the platform-assigned id you will use everywhere else — to ship, to track and to get the label.
When it fails
| Status | Meaning |
|---|---|
400 | One or more fields failed validation. |
401 | Missing or invalid access token. |
409 | A parcel with that external_id already exists. |
422 | Well-formed but semantically wrong — typically an incomplete location. |
See Error handling.
Updated 2 days ago
