shipment

Estimate the cost and timing of a shipment.

Calculates the estimated price, pickup time, and delivery time for the given parcels using the specified shipping type.

The response also includes the asset_kind (vehicle type) that would be assigned to each delivery. This is only meaningful for express (on-demand) deliveries: it is chosen deterministically as the smallest available vehicle — in bicycle → moped → car priority order — that can fit the whole delivery by weight, volume and largest-parcel dimensions and still complete the route in time. For same_day, next_day and other cross-dock modalities the returned value does not reflect the vehicle that will actually carry the parcel and should be ignored. See the AssetKind schema for the exact per-vehicle limits used to make this choice.

post/v3/parcels/estimate

Request

  • Base URL
    https://logistics.api.cabify-sandbox.com
  • URL
    https://logistics.api.cabify-sandbox.com/v3/parcels/estimate
  • Auth
    HTTP bearer

Request body

shipping_type_idstring required

Identifier of the shipping type to estimate, as returned for the pickup location by GET /v1/shipping_types/available. Opaque and environment-dependent: send it back exactly as it was returned.

pickup_timestring date-time

Desired pickup time, formatted according to RFC 3339, section 5.6.

with_returnboolean

Request a return leg: after the delivery, the rider goes back to the pickup point in the same journey. Returns must be enabled for the shipping type; asking for one on a shipping type without it fails with shipping type not enabled for return.

Example request

{
  "parcels": [
    {
      "external_id": "parcel_001",
      "pickup_location": {
        "lat": 40.4489254,
        "lon": -3.6730293
      },
      "dropoff_location": {
        "lat": 40.4489254,
        "lon": -3.6730293
      },
      "dimensions": {
        "height": 10,
        "length": 10,
        "width": 10
      },
      "weight": {
        "value": 1500
      }
    }
  ],
  "shipping_type_id": "express_default",
  "pickup_time": "2021-12-02T10:12:07.753Z"
}

Response

Estimation calculated successfully.

Example response

{
  "deliveries": [
    {
      "parcels": [
        {
          "external_id": "parcel_001",
          "pickup_location": {
            "lat": 40.4489254,
            "lon": -3.6730293
          },
          "dropoff_location": {
            "lat": 40.4489254,
            "lon": -3.6730293
          },
          "dimensions": {
            "height": 10,
            "length": 10,
            "width": 10
          },
          "weight": {
            "value": 1500
          }
        }
      ],
      "estimation": {
        "price": {
          "amount": 630,
          "currency": "EUR"
        },
        "asset_kind": "moped",
        "eta_to_pickup": "2021-12-02T10:12:07.753Z",
        "eta_to_delivery": "2021-12-02T10:12:47.753Z"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.