Zone Pricing
5 API calls in this section.
List Zone Pricing
/delivery/zone-pricing?page=1&limit=10&origin_zone_id=&destination_zone_id=&origin_tag_id=&destination_tag_id=&origin_selector_type=&destination_selector_type=&service_id=&active=true&column_filters={"status":"true","service_code":"EC","base_price":{"min":500,"max":2000}}&sort_by=created_at&sort_order=desc&tenant_id=&language=enList pricing rules with direct filters, AdvancedDataGrid column_filters, server-side sorting, pagination, and tenant-scoped KPI stats.
1curl --request GET "$ONDI_BASE_URL/delivery/zone-pricing?page=1&limit=10&origin_zone_id=&destination_zone_id=&origin_tag_id=&destination_tag_id=&origin_selector_type=&destination_selector_type=&service_id=&active=true&column_filters={"status":"true","service_code":"EC","base_price":{"min":500,"max":2000}}&sort_by=created_at&sort_order=desc&tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
pageOptional1
Page number for pagination
limitOptional10
Number of items per page
origin_zone_idOptionalFilter by origin zone ID
destination_zone_idOptionalFilter by destination zone ID
origin_tag_idOptionalFilter by origin tag ID
destination_tag_idOptionalFilter by destination tag ID
origin_selector_typeOptionalFilter by origin selector type (zone|tag)
destination_selector_typeOptionalFilter by destination selector type (zone|tag)
service_idOptionalFilter by service type
activeOptionaltrue
Filter by active status (true/false)
column_filtersOptional{"status":"true","service_code":"EC","base_price":{"min":500,"max":2000}}
JSON object for grid column filters. Supports status, origin_selector_type, destination_selector_type, service_code, numeric ranges, and effective date ranges.
sort_byOptionalcreated_at
Sort field. Allowed: base_price, per_unit_price, carrier_price, min_transit_time, max_transit_time, effective_from, effective_to, service.name, created_at
sort_orderOptionaldesc
Sort direction (asc|desc). Defaults to desc.
tenant_idOptionalTenant ID (defaults to authenticated user's tenant)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Get Zone Pricing
/delivery/zone-pricing/:pricingId?tenant_id=&language=enGet details for a pricing rule. Response includes full arrays: origins[{id,name,code}], destinations[{id,name,code}].
1curl --request GET "$ONDI_BASE_URL/delivery/zone-pricing/:pricingId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
pricingIdRequireduuid
ID of the pricing rule to retrieve
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Create Zone Pricing
/delivery/zone-pricing?tenant_id=Create a new pricing rule using selector types per side (zone or tag).
1curl --request POST "$ONDI_BASE_URL/delivery/zone-pricing?tenant_id=" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "origin_selector_type": "zone",7 "destination_selector_type": "tag",8 "origin_zone_ids": [9 "uuid-origin-1"10 ],11 "destination_tag_ids": [12 "uuid-tag-erbil"13 ],14 "service_id": "uuid-service",15 "base_price": 10.5,16 "per_unit_price": 0.75,17 "min_transit_time": 30,18 "max_transit_time": 60,19 "pricing_rules": {},20 "effective_from": "2025-01-01",21 "effective_to": null22}'1{2 "origin_selector_type": "zone",3 "destination_selector_type": "tag",4 "origin_zone_ids": [5 "uuid-origin-1"6 ],7 "destination_tag_ids": [8 "uuid-tag-erbil"9 ],10 "service_id": "uuid-service",11 "base_price": 10.5,12 "per_unit_price": 0.75,13 "min_transit_time": 30,14 "max_transit_time": 60,15 "pricing_rules": {},16 "effective_from": "2025-01-01",17 "effective_to": null18}Query parameters
tenant_idOptionalTenant ID (defaults to authenticated user's tenant)
Request body fields
origin_selector_typeExampleExample field from the request body.
destination_selector_typeExampleExample field from the request body.
origin_zone_idsExampleExample field from the request body.
destination_tag_idsExampleExample field from the request body.
service_idExampleExample field from the request body.
base_priceExampleExample field from the request body.
per_unit_priceExampleExample field from the request body.
min_transit_timeExampleExample field from the request body.
max_transit_timeExampleExample field from the request body.
pricing_rulesExampleExample field from the request body.
effective_fromExampleExample field from the request body.
effective_toExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
No response example is available for this endpoint yet.
Update Zone Pricing
/delivery/zone-pricing/:pricingId?tenant_id=&language=enUpdate an existing pricing rule with zone/tag selector support. Exact zone rules are prioritized during runtime price resolution.
1curl --request PUT "$ONDI_BASE_URL/delivery/zone-pricing/:pricingId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "origin_selector_type": "tag",7 "destination_selector_type": "zone",8 "origin_tag_ids": [9 "uuid-tag-erbil"10 ],11 "destination_zone_ids": [12 "uuid-dest-1",13 "uuid-dest-2"14 ],15 "service_id": "uuid-service",16 "base_price": 12.5,17 "per_unit_price": 0.85,18 "min_transit_time": 24,19 "max_transit_time": 72,20 "pricing_rules": {},21 "effective_from": "2025-01-01",22 "effective_to": null23}'1{2 "origin_selector_type": "tag",3 "destination_selector_type": "zone",4 "origin_tag_ids": [5 "uuid-tag-erbil"6 ],7 "destination_zone_ids": [8 "uuid-dest-1",9 "uuid-dest-2"10 ],11 "service_id": "uuid-service",12 "base_price": 12.5,13 "per_unit_price": 0.85,14 "min_transit_time": 24,15 "max_transit_time": 72,16 "pricing_rules": {},17 "effective_from": "2025-01-01",18 "effective_to": null19}Path parameters
pricingIdRequireduuid
ID of the pricing rule to update
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
origin_selector_typeExampleExample field from the request body.
destination_selector_typeExampleExample field from the request body.
origin_tag_idsExampleExample field from the request body.
destination_zone_idsExampleExample field from the request body.
service_idExampleExample field from the request body.
base_priceExampleExample field from the request body.
per_unit_priceExampleExample field from the request body.
min_transit_timeExampleExample field from the request body.
max_transit_timeExampleExample field from the request body.
pricing_rulesExampleExample field from the request body.
effective_fromExampleExample field from the request body.
effective_toExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{\n "success": true,\n "message": "Pricing rule updated successfully"\n}1{\n "success": false,\n "message": "Pricing rule not found"\n}1{\n "success": false,\n "message": "Validation failed",\n "errors": [\n {\n "field": "effective_to",\n "message": "effective_to_must_be_after_effective_from"\n }\n ]\n}1{\n "success": false,\n "message": "Validation failed",\n "errors": [\n {\n "field": "min_transit_time",\n "message": "min_transit_time_must_be_less_than_max_transit_time"\n }\n ]\n}1{\n "success": false,\n "message": "Origin zone not found"\n}1{\n "success": false,\n "message": "Destination zone not found"\n}1{\n "success": false,\n "message": "Service type not found"\n}1{\n "success": false,\n "message": "Overlapping pricing rule exists",\n "existing_rule_ids": ["existing_rule_uuid_1"]\n}1{\n "success": false,\n "message": "Insufficient permissions"\n}1{\n "success": false,\n "message": "Tenant not found"\n}1{\n "success": false,\n "message": "Internal server error"\n}Delete Zone Pricing
/delivery/zone-pricing/:pricingId?tenant_id=&language=enDelete an existing pricing rule.
1curl --request DELETE "$ONDI_BASE_URL/delivery/zone-pricing/:pricingId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
pricingIdRequireduuid
ID of the pricing rule to delete
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.