Estimate

Estimating tells you the price, the pickup ETA and the delivery ETA of a shipment before you create anything. You describe where each parcel is collected and where it goes; nothing is registered and nothing is charged.

Use it to show a price to your customer, to decide between shipping types, or to check that a route can be served at all.

Request

curl --request POST \
  --url https://logistics.api.{{BASE_ENV_URL}}/v3/parcels/estimate \
  --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
  --header 'Content-Type: application/json' \
  --data '{
    "shipping_type_id": "express_default",
    "parcels": [
      {
        "external_id": "order_1042",
        "pickup_location": { "lat": 40.456367, "lon": -3.690587 },
        "dropoff_location": { "address": "Calle de Pradillo, 42, Madrid" },
        "dimensions": { "height": 10, "length": 20, "width": 15, "unit": "cm" },
        "weight": { "value": 1500, "unit": "g" }
      }
    ]
  }'
FieldRequiredNotes
shipping_type_idYesFrom Available shipping types for this pickup location — the id is the same everywhere, but the type has to be active there. Echo it back exactly as returned: it is opaque, a readable name in sandbox and a UUID in production.
parcelsYesAt least one. Estimated together as a single delivery.
parcels[].pickup_locationYesCoordinates (lat, lon) or an address.
parcels[].dropoff_locationYesSame.
parcels[].dimensionsNoDefaults to cm. Affects which vehicle can take the delivery.
parcels[].weightNoDefaults to g. Same.
pickup_timeNoRFC 3339. When the parcels are ready to be collected.

Response

{
  "deliveries": [
    {
      "parcels": [ { "external_id": "order_1042", "...": "..." } ],
      "estimation": {
        "asset_kind": "moped",
        "price": { "amount": 599, "currency": "EUR" },
        "eta_to_pickup": "2021-12-02T10:12:07.753Z",
        "eta_to_delivery": "2021-12-02T10:48:07.753Z"
      }
    }
  ]
}

price.amount is in the minor unit of the currency (599 = 5.99 EUR).

📘

asset_kind only means something for express

For express deliveries it is the smallest vehicle — in bicycle → moped → car order — that fits the whole delivery by weight, volume and largest-parcel dimensions and can still complete the route in time. For same_day, next_day and other cross-dock modalities it does not reflect the vehicle that will actually carry the parcel, and should be ignored.

When it fails

StatusMeaning
400A field failed validation — most often a parcel with neither an address nor coordinates.
401Missing or invalid access token.
404The estimation could not be calculated. Check that both locations are inside an operating area.
409The service cannot process the request in its current state.
503Temporarily unavailable; retry.

An estimate is not a reservation: the price and the ETAs are calculated for that moment and can change by the time you request the shipment.


Did this page help you?