Zones
7 API calls in this section.
List Zones
/delivery/zonesList delivery zones with pagination, advanced column filters, sorting, and tenant-wide stats. Requires valid authentication.
Query parameters
| Parameter | Type | Description |
|---|---|---|
pageOptional | string | Page number for pagination (default: 1) Example: |
limitOptional | string | Number of items per page (default: 10, max: 100) Example: |
is_activeOptional | string | Filter by active status (true/false) Example: |
inbound_enabledOptional | string | Filter zones by inbound external integration status (true/false) Filter by inbound external integration status (true/false) |
outbound_enabledOptional | string | Filter zones by outbound external integration status (true/false) Filter by outbound external integration status (true/false) |
external_integrationOptional | string | Filter zones by external integration enabled/disabled status (true/false) Filter by external integration enabled/disabled status (true/false) |
nameOptional | string | Filter zones by name (partial match) |
codeOptional | string | Filter zones by exact code match |
searchOptional | string | Search by zone name or code |
carrier_codeOptional | string | Filter zones by enabled external carrier code Filter by enabled external carrier code |
sort_by | string | Sort by one of: name, code, |
sort_orderOptional | string | Sort order: asc or desc. Defaults to desc when |
column_filtersOptional | string | JSON string with column filters. Supported keys: name, code, |
tenant_idOptional | string | Tenant ID (optional if in auth token) Tenant ID (defaults to authenticated user's tenant) |
languageOptional | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/zones?page=1&limit=10&is_active=true&inbound_enabled=&outbound_enabled=&external_integration=&name=&code=&search=&carrier_code=&sort_by=&sort_order=&column_filters=&tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Zones retrieved successfully",4 "zones": [5 {6 "id": "uuid",7 "name": "Downtown",8 "code": "DT-01",9 "internal_enabled": true,10 "is_active": true,11 "created_at": "2023-01-01T00:00:00Z",12 "updated_at": "2023-01-02T00:00:00Z",13 "boundaries": {14 "type": "polygon",15 "coordinates": []16 },17 "zone_geom": null,18 "zone_metadata": {19 "population_density": "high"20 },21 "tags": [22 "erbil",23 "airport"24 ],25 "external_integration": {26 "carrier_code": "PRIME",27 "is_enabled": true,28 "inbound_enabled": true,29 "outbound_enabled": true,30 "warehouse_id": "uuid"31 }32 }33 ],34 "stats": {35 "totalZones": 5,36 "activeZones": 4,37 "externalZones": 2,38 "recentlyAdded": [39 {40 "name": "Airport Zone",41 "created_at": "2025-10-01T00:00:00Z"42 }43 ]44 },45 "page": 1,46 "limit": 10,47 "total": 548}Create Zone
/delivery/zonesCreate a new delivery zone. Requires manage:operations:tenant permission.
Requires valid authentication token with manage:operations:tenant permission
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) Tenant ID (defaults to authenticated user's tenant) |
languageOptional | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
code | string | — |
boundaries | object | — |
boundaries.type | string | — |
boundaries.coordinates | array | — |
zone_metadata | object | — |
zone_metadata.population_density | string | — |
tags | array<string> | — |
is_active | boolean | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/zones?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Downtown",6 "code": "DT-01",7 "boundaries": {8 "type": "polygon",9 "coordinates": []10 },11 "zone_metadata": {12 "population_density": "high"13 },14 "tags": [15 "Erbil",16 "Airport"17 ],18 "is_active": true19}'Other request examples (1)
1{2 "name": "Downtown",3 "code": "DT-01",4 "boundaries": {5 "type": "polygon",6 "coordinates": []7 },8 "zone_metadata": {9 "population_density": "high"10 },11 "is_active": true12}Response examples
1{2 "success": true,3 "message": "Zone created successfully"4}Get Zone
/delivery/zones/:zoneIdGet details of a specific delivery zone. Requires view:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
zoneIdRequired | string | ID of the zone to retrieve Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) Tenant ID (defaults to authenticated user's tenant) |
languageOptional | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/zones/${ZONEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Zone retrieved successfully",4 "zone": {5 "id": "uuid",6 "tenant_id": "uuid",7 "name": "Downtown",8 "code": "DT-01",9 "boundaries": {10 "type": "polygon",11 "coordinates": []12 },13 "zone_metadata": {14 "population_density": "high"15 },16 "tags": [17 "erbil",18 "airport"19 ],20 "is_active": true,21 "created_at": "2023-01-01T00:00:00Z",22 "updated_at": "2023-01-02T00:00:00Z"23 }24}Update Zone
/delivery/zones/:zoneIdUpdate an existing delivery zone. Requires manage:operations:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
zoneIdRequired | string | ID of the zone to update Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
code | string | — |
boundaries | object | — |
boundaries.type | string | — |
boundaries.coordinates | array | — |
zone_metadata | object | — |
zone_metadata.population_density | string | — |
tags | array<string> | — |
is_active | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/zones/${ZONEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Downtown Updated",6 "code": "DT-01-UPD",7 "boundaries": {8 "type": "polygon",9 "coordinates": []10 },11 "zone_metadata": {12 "population_density": "medium"13 },14 "tags": [15 "Erbil",16 "Out Of City"17 ],18 "is_active": true19}'Response examples
1{2 "success": true,3 "message": "Zone updated successfully",4 "zone": {5 "id": "uuid",6 "name": "Downtown Updated",7 "tags": [8 "erbil",9 "out of city"10 ],11 "updated_at": "2023-01-02T00:00:00Z"12 }13}Delete Zone
/delivery/zones/:zoneIdHard-delete a delivery zone after checks
blocks if any non-terminal delivery (status not delivered/failed/cancelled/returned) references the zone as pickup or dropoff zone, or if the zone appears in zone pricing origin/destination rules. Clears the zone id from all drivers' preferred_zone_ids for the tenant. Requires manage:operations:tenant permission. Apply migration 20260331130000_zone_delete_driver_preferences_and_delivery_zone_fk so remove_zone_from_tenant_driver_preferences exists and historical deliveries can release FKs (SET NULL).
Path parameters
| Parameter | Type | Description |
|---|---|---|
zoneIdRequired | string | ID of the zone to delete Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/zones/${ZONEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Zone deleted successfully",4 "data": null5}List Zone Tags
/delivery/zone-tagsList tenant zone tags for tag autocomplete.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Example: |
limit | string | Example: |
search | string | — |
tenant_id | string | — |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Response examples
1{2 "success": true,3 "message": "Zone tags retrieved successfully",4 "tags": [5 {6 "id": "uuid-tag-1",7 "name": "erbil"8 },9 {10 "id": "uuid-tag-2",11 "name": "airport"12 }13 ],14 "page": 1,15 "limit": 20,16 "total": 217}Show Zone Pricing (Perspective)
/delivery/zones/:zoneId/pricingShow all pricing rules related to this zone. Each row is projected from the zone perspective: the matched side contains only the main zone, the counterparty side contains all zones/tags, and rule.services contains every active service covered by the rule. service_id filters by membership in that array. rule.services is the only service response field.
Path parameters
| Parameter | Type | Description |
|---|---|---|
zoneIdRequired | string | ID of the zone to show pricing for Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Example: |
limit | string | Example: |
service_id | string | — |
active | string | — |
tenant_id | string | — |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/zones/${ZONEID}/pricing?page=1&limit=50&service_id=&active=&tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Zone Pricing Retrieved Successfully",4 "zone": {5 "id": "uuid",6 "name": "Downtown",7 "code": "DT-01"8 },9 "pricing": [10 {11 "rule": {12 "id": "uuid",13 "active": true,14 "base_price": 10.5,15 "per_unit_price": 0.75,16 "effective_from": "2025-01-01",17 "effective_to": null,18 "origin_selector_type": "zone",19 "destination_selector_type": "tag",20 "origin_zones_count": 2,21 "destination_tags_count": 1,22 "services": [23 {24 "id": "uuid-standard",25 "name": "Standard Delivery",26 "code": "STD"27 },28 {29 "id": "uuid-express",30 "name": "Express Delivery",31 "code": "EXP"32 }33 ]34 },35 "match": {36 "matched_side": "origin",37 "matched_by": "zone",38 "matched_tags": []39 },40 "origin": {41 "selector_type": "zone",42 "zones": [43 {44 "id": "uuid",45 "name": "Downtown",46 "code": "DT-01"47 }48 ],49 "tags": []50 },51 "destination": {52 "selector_type": "tag",53 "zones": [],54 "tags": [55 {56 "id": "uuid",57 "name": "erbil"58 }59 ]60 }61 }62 ],63 "page": 1,64 "limit": 50,65 "total": 166}