Price
1 API call in this section.
Get Price
/customer/delivery/priceCalculates delivery price for given coordinates and service. Optional purpose=return (body or query) requires an active customer-accessible service with allow_returns=true; otherwise HTTP 403 returns return_delivery_service_not_allowed. Unit size is derived from measured package items; when no usable measurements exist, the configured general.unit_size.settings.missing_unit_size_fallback is applied. Success also returns unit_size and unit_size_source. If the calculated unit is outside the service range, HTTP 400 returns code can_not_use_this_delivery_for_this_unit_size, a localized message, field=unit_size, calculated_unit_size, allowed_unit_min, allowed_unit_max, and violation. Frontend should display message and use code only for branching.
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
delivery_service_id | string | — |
purpose | string | — |
pickup_lat | number | — |
pickup_lng | number | — |
dropoff_lat | number | — |
dropoff_lng | number | — |
package | object | — |
package.items | array<object> | — |
package.items.quantity | number | — |
package.items.weight | number | — |
package.items.length | number | — |
package.items.width | number | — |
Show 1 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
package.items.height | number | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/customer/delivery/price" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "delivery_service_id": "uuid",6 "purpose": "return",7 "pickup_lat": 40.7128,8 "pickup_lng": -74.006,9 "dropoff_lat": 40.7589,10 "dropoff_lng": -73.9851,11 "package": {12 "items": [13 {14 "quantity": 1,15 "weight": 1.5,16 "length": 30,17 "width": 20,18 "height": 1519 }20 ]21 }22}'Response examples
1{2 "success": true,3 "data": {4 "price": 25.55 }6}