Skip to main content

Price

1 API call in this section.

Get Price​

Customer Portal / Delivery Management / Price
POST/customer/delivery/price

Calculates 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

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
delivery_service_idstring—
purposestring—
pickup_latnumber—
pickup_lngnumber—
dropoff_latnumber—
dropoff_lngnumber—
packageobject—
package.itemsarray<object>—
package.items.quantitynumber—
package.items.weightnumber—
package.items.lengthnumber—
package.items.widthnumber—
Show 1 more body fields

Additional body parameters

ParameterTypeDescription
package.items.heightnumber—
Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "data": {4    "price": 25.55  }6}