Delivery
1 API call in this section.
Calculate Delivery Fee
Public APIs / Storefront / Delivery
POST
/public/storefront/:storeSlug/delivery/priceCalculate delivery fee for a cart before placing an order. Does not create any order or booking. No auth required. Required body: - delivery_service_id: UUID of the delivery service - dropoff.latitude / dropoff.longitude: customer drop-off coordinates - items: array of { variant_id, quantity }
Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request POST "$ONDI_BASE_URL/public/storefront/:storeSlug/delivery/price" \2 --header "Content-Type: application/json" \3 --header "Content-Type: application/json" \4 --data '{5 "delivery_service_id": "service-uuid",6 "dropoff": {7 "latitude": 33.3152,8 "longitude": 44.36619 },10 "items": [11 {12 "variant_id": "variant-uuid-1",13 "quantity": 214 },15 {16 "variant_id": "variant-uuid-2",17 "quantity": 118 }19 ]20}'Request body
json
1{2 "delivery_service_id": "service-uuid",3 "dropoff": {4 "latitude": 33.3152,5 "longitude": 44.36616 },7 "items": [8 {9 "variant_id": "variant-uuid-1",10 "quantity": 211 },12 {13 "variant_id": "variant-uuid-2",14 "quantity": 115 }16 ]17}Path parameters
storeSlugRequiredpath string
my-store
Request body fields
delivery_service_idExamplestring
Example field from the request body.
dropoffExampleobject
Example field from the request body.
dropoff.latitudeExamplenumber
Example field from the request body.
dropoff.longitudeExamplenumber
Example field from the request body.
itemsExamplearray<object>
Example field from the request body.
items.variant_idExamplestring
Example field from the request body.
items.quantityExamplenumber
Example field from the request body.
Headers
Content-TypeOptionalheader string
application/json
Responses
Success200OK
Response body
json
1{2 "success": true,3 "data": {4 "delivery_fee": 3.5,5 "currency": "USD",6 "breakdown": {7 "base_fee": 2,8 "distance_fee": 1.59 }10 }11}Validation Error400Bad Request
Response body
json
1{2 "success": false,3 "message": "delivery_service_id is required"4}