Skip to main content

Zone Pricing

5 API calls in this section.

List Zone Pricing

Delivery & Last-Mile / Zone Pricing
GET/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

List pricing rules with direct filters, AdvancedDataGrid column_filters, server-side sorting, pagination, and tenant-scoped KPI stats.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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

pageOptional
query string

1

Page number for pagination

limitOptional
query string

10

Number of items per page

origin_zone_idOptional
query string

Filter by origin zone ID

destination_zone_idOptional
query string

Filter by destination zone ID

origin_tag_idOptional
query string

Filter by origin tag ID

destination_tag_idOptional
query string

Filter by destination tag ID

origin_selector_typeOptional
query string

Filter by origin selector type (zone|tag)

destination_selector_typeOptional
query string

Filter by destination selector type (zone|tag)

service_idOptional
query string

Filter by service type

activeOptional
query string

true

Filter by active status (true/false)

column_filtersOptional
query string

{"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_byOptional
query string

created_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_orderOptional
query string

desc

Sort direction (asc|desc). Defaults to desc.

tenant_idOptional
query string

Tenant ID (defaults to authenticated user's tenant)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK

Get Zone Pricing

Delivery & Last-Mile / Zone Pricing
GET/delivery/zone-pricing/:pricingId?tenant_id=&language=en

Get details for a pricing rule. Response includes full arrays: origins[{id,name,code}], destinations[{id,name,code}].

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/zone-pricing/:pricingId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

pricingIdRequired
path string

uuid

ID of the pricing rule to retrieve

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Pricing Rule Not Found404Not Found

Create Zone Pricing

Delivery & Last-Mile / Zone Pricing
POST/delivery/zone-pricing?tenant_id=

Create a new pricing rule using selector types per side (zone or tag).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
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_idOptional
query string

Tenant ID (defaults to authenticated user's tenant)

Request body fields

origin_selector_typeExample
string

Example field from the request body.

destination_selector_typeExample
string

Example field from the request body.

origin_zone_idsExample
array<string>

Example field from the request body.

destination_tag_idsExample
array<string>

Example field from the request body.

service_idExample
string

Example field from the request body.

base_priceExample
number

Example field from the request body.

per_unit_priceExample
number

Example field from the request body.

min_transit_timeExample
number

Example field from the request body.

max_transit_timeExample
number

Example field from the request body.

pricing_rulesExample
object

Example field from the request body.

effective_fromExample
string

Example field from the request body.

effective_toExample
null

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Update Zone Pricing

Delivery & Last-Mile / Zone Pricing
PUT/delivery/zone-pricing/:pricingId?tenant_id=&language=en

Update an existing pricing rule with zone/tag selector support. Exact zone rules are prioritized during runtime price resolution.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
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

pricingIdRequired
path string

uuid

ID of the pricing rule to update

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

origin_selector_typeExample
string

Example field from the request body.

destination_selector_typeExample
string

Example field from the request body.

origin_tag_idsExample
array<string>

Example field from the request body.

destination_zone_idsExample
array<string>

Example field from the request body.

service_idExample
string

Example field from the request body.

base_priceExample
number

Example field from the request body.

per_unit_priceExample
number

Example field from the request body.

min_transit_timeExample
number

Example field from the request body.

max_transit_timeExample
number

Example field from the request body.

pricing_rulesExample
object

Example field from the request body.

effective_fromExample
string

Example field from the request body.

effective_toExample
null

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Response body
json
1{\n  "success": true,\n  "message": "Pricing rule updated successfully"\n}
Error - Pricing Rule Not Found404Not Found
Response body
json
1{\n  "success": false,\n  "message": "Pricing rule not found"\n}
Error - Validation Failed (effective_dates)400Bad Request
Response body
json
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}
Error - Validation Failed (transit_times)400Bad Request
Response body
json
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}
Error - Origin Zone Not Found404Not Found
Response body
json
1{\n  "success": false,\n  "message": "Origin zone not found"\n}
Error - Destination Zone Not Found404Not Found
Response body
json
1{\n  "success": false,\n  "message": "Destination zone not found"\n}
Error - Service Type Not Found404Not Found
Response body
json
1{\n  "success": false,\n  "message": "Service type not found"\n}
Error - Overlapping Rule409Conflict
Response body
json
1{\n  "success": false,\n  "message": "Overlapping pricing rule exists",\n  "existing_rule_ids": ["existing_rule_uuid_1"]\n}
Error - Insufficient Permissions403Forbidden
Response body
json
1{\n  "success": false,\n  "message": "Insufficient permissions"\n}
Error - Tenant Not Found404Not Found
Response body
json
1{\n  "success": false,\n  "message": "Tenant not found"\n}
Error - Internal Server Error500Internal Server Error
Response body
json
1{\n  "success": false,\n  "message": "Internal server error"\n}

Delete Zone Pricing

Delivery & Last-Mile / Zone Pricing
DELETE/delivery/zone-pricing/:pricingId?tenant_id=&language=en

Delete an existing pricing rule.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request DELETE "$ONDI_BASE_URL/delivery/zone-pricing/:pricingId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

pricingIdRequired
path string

uuid

ID of the pricing rule to delete

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.