Price
1 API call in this section.
Get Price
Customer Portal / Delivery Management / Price
POST
/customer/delivery/priceCalculates delivery price for given coordinates and service. Unit size is automatically derived from package items.
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/customer/delivery/price" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "delivery_service_id": "uuid",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}'Request body
json
1{2 "delivery_service_id": "uuid",3 "pickup_lat": 40.7128,4 "pickup_lng": -74.006,5 "dropoff_lat": 40.7589,6 "dropoff_lng": -73.9851,7 "package": {8 "items": [9 {10 "quantity": 1,11 "weight": 1.5,12 "length": 30,13 "width": 20,14 "height": 1515 }16 ]17 }18}Request body fields
delivery_service_idExamplestring
Example field from the request body.
pickup_latExamplenumber
Example field from the request body.
pickup_lngExamplenumber
Example field from the request body.
dropoff_latExamplenumber
Example field from the request body.
dropoff_lngExamplenumber
Example field from the request body.
packageExampleobject
Example field from the request body.
package.itemsExamplearray<object>
Example field from the request body.
package.items.quantityExamplenumber
Example field from the request body.
package.items.weightExamplenumber
Example field from the request body.
package.items.lengthExamplenumber
Example field from the request body.
package.items.widthExamplenumber
Example field from the request body.
package.items.heightExamplenumber
Example field from the request body.
Headers
AuthorizationOptionalheader string
Bearer {{access_token}}
Content-TypeOptionalheader string
application/json
Responses
Success200OK
Response body
json
1{2 "success": true,3 "data": {4 "price": 25.55 }6}