Skip to main content

Delivery

1 API call in this section.

Calculate Delivery Fee

Public APIs / Storefront / Delivery
POST/public/storefront/:storeSlug/delivery/price

Calculate 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

storeSlugRequired
path string

my-store

Request body fields

delivery_service_idExample
string

Example field from the request body.

dropoffExample
object

Example field from the request body.

dropoff.latitudeExample
number

Example field from the request body.

dropoff.longitudeExample
number

Example field from the request body.

itemsExample
array<object>

Example field from the request body.

items.variant_idExample
string

Example field from the request body.

items.quantityExample
number

Example field from the request body.

Headers

Content-TypeOptional
header 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}