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.

Path parameters

ParameterTypeDescription
storeSlugRequiredstring

Example: my-store

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
delivery_service_idRequiredstring

UUID of the delivery service

dropoffobject—
dropoff.latitudeRequirednumber

/ dropoff.longitude: customer drop-off coordinates

dropoff.longitudenumber—
itemsRequiredarray<object>

array of { variant_id, quantity }

items.variant_idstring—
items.quantitynumber—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/public/storefront/${STORESLUG}/delivery/price" \2  --header "Content-Type: application/json" \3  --data-raw '{4  "delivery_service_id": "service-uuid",5  "dropoff": {6    "latitude": 33.3152,7    "longitude": 44.36618  },9  "items": [10    {11      "variant_id": "variant-uuid-1",12      "quantity": 213    },14    {15      "variant_id": "variant-uuid-2",16      "quantity": 117    }18  ]19}'

Response examples

200OK
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}