Skip to main content

Delivery Services

5 API calls in this section.

List Delivery Services

Delivery & Last-Mile / Delivery Services
GET/delivery/services?page=1&limit=10&service_level=&active=true&delivery_type=&delivery_type_code=&search=&price_order=&column_filters={"service_level":"express","active":"true","default_price":{"min":100,"max":5000},"signature_required":"true"}&sort_by=created_at&sort_order=desc&tenant_id=&customer_id=

List delivery services with direct filters, AdvancedDataGrid column_filters, server-side sorting, pagination, customer-access scoping, and tenant-scoped KPI stats. Authentication: - Requires valid authentication token Query Parameters: - page (optional): Page number for pagination (default: 1) - limit (optional): Number of items per page (default: 10, max: 100) - service_level (optional): economy|standard|express|same_day|next_day|scheduled - active (optional): true/false - delivery_type (optional): delivery_type_id (UUID) - delivery_type_code (optional): delivery_type.code - search (optional): ilike on name/code - price_order (optional): legacy asc/desc sort on default_price - column_filters (optional): JSON string with keys name, code, description, service_level, delivery_type_code, active, default_price, unit_min, unit_max, estimated_delivery_time_min, estimated_delivery_time_max, signature_required, insurance_available, created_at - sort_by (optional): name, code, default_price, unit_min, unit_max, service_level, estimated_delivery_time_min, estimated_delivery_time_max, priority, created_at, updated_at - sort_order (optional): asc or desc (defaults to desc when sort_by is provided) - tenant_id (optional): Tenant ID (defaults to authenticated user's tenant) - customer_id (optional): user_id of customer; auto-applied when caller is a business customer

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/services?page=1&limit=10&service_level=&active=true&delivery_type=&delivery_type_code=&search=&price_order=&column_filters={"service_level":"express","active":"true","default_price":{"min":100,"max":5000},"signature_required":"true"}&sort_by=created_at&sort_order=desc&tenant_id=&customer_id=" \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

service_levelOptional
query string

Filter by service level (economy, standard, express, same_day, next_day, scheduled)

activeOptional
query string

true

Filter by active status (true/false)

delivery_typeOptional
query string

Filter by delivery_type_id (UUID)

delivery_type_codeOptional
query string

Filter by delivery_type.code

searchOptional
query string

Search by name or code (ilike)

price_orderOptional
query string

Order by default_price (asc/desc)

column_filtersOptional
query string

{"service_level":"express","active":"true","default_price":{"min":100,"max":5000},"signature_required":"true"}

JSON object for grid column filters. Supports text, exact, boolean, numeric range, and created_at date-range filters.

sort_byOptional
query string

created_at

Sort field. Allowed: name, code, default_price, unit_min, unit_max, service_level, estimated_delivery_time_min, estimated_delivery_time_max, priority, created_at, updated_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)

customer_idOptional
query string

Filter by customer (user) ID to see available services for that customer. If the authenticated user is a customer/no-role business user, this is applied automatically.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK

Create Delivery Service

Delivery & Last-Mile / Delivery Services
POST/delivery/services?tenant_id=

Create a new delivery service. Requires manage:operations:tenant permission. Authentication: - Requires valid authentication token with manage:operations:tenant permission Query Parameters: - tenant_id (optional): Tenant ID (optional if in auth token) Required Body Fields: - name (string OR localized object {en, ar, ku}), code, service_level, delivery_type_id, unit_min, unit_max Optional Body Fields: - description (string OR localized object), image_url (string), priority (integer) - default_price, estimated_delivery_time_min, estimated_delivery_time_max, service_options, active - access_mode (all_users|select_users|exclude_users), user_ids (required if access_mode is select_users or exclude_users) - zone_access_mode (all_zones|select_zones|exclude_zones) - zone_selector_type (zone|tag, default: zone) - When zone_selector_type=zone: zone_ids required if zone_access_mode is select_zones or exclude_zones - When zone_selector_type=tag: zone_tag_ids required if zone_access_mode is select_zones or exclude_zones Errors: - 404 delivery_type_not_found - 409 service_code_already_exists - 400 customer_ids_required_for_selected_access_mode - 400 zone_ids_required_for_selected_zone_mode - 400 invalid_zone_ids - 400 zone_tag_ids_required_for_tag_selector - 400 invalid_zone_tag_ids - 500 internal_server_error

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/services?tenant_id=" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": {7    "en": "Express 24-Hour Delivery",8    "ar": "خدمة التوصيل السريع خلال 24 ساعة",9    "ku": "گەیاندنی خێرا 24 کاتژمێر"10  },11  "code": "EXP24",12  "description": {13    "en": "Premium express delivery service",14    "ar": "خدمة توصيل سريع مميزة",15    "ku": "خزمەتگوزاری گەیاندنی خێرای پریمیوم"16  },17  "image_url": "https://cdn.example.com/tenants/tenant_123/delivery-services/service-icon.png",18  "priority": 10,19  "service_level": "express",20  "default_price": 25.99,21  "estimated_delivery_time_min": 12,22  "estimated_delivery_time_max": 24,23  "unit_min": 1,24  "unit_max": 10,25  "service_options": {26    "tracking": true,27    "signature_required": true,28    "insurance_available": true29  },30  "delivery_type_id": "uuid",31  "active": true,32  "access_mode": "select_users",33  "user_ids": [34    "user_uuid_1",35    "user_uuid_2"36  ],37  "zone_access_mode": "select_zones",38  "zone_selector_type": "tag",39  "zone_tag_ids": [40    "tag_uuid_1",41    "tag_uuid_2"42  ]43}'
Request body
json
1{2  "name": {3    "en": "Express 24-Hour Delivery",4    "ar": "خدمة التوصيل السريع خلال 24 ساعة",5    "ku": "گەیاندنی خێرا 24 کاتژمێر"6  },7  "code": "EXP24",8  "description": {9    "en": "Premium express delivery service",10    "ar": "خدمة توصيل سريع مميزة",11    "ku": "خزمەتگوزاری گەیاندنی خێرای پریمیوم"12  },13  "image_url": "https://cdn.example.com/tenants/tenant_123/delivery-services/service-icon.png",14  "priority": 10,15  "service_level": "express",16  "default_price": 25.99,17  "estimated_delivery_time_min": 12,18  "estimated_delivery_time_max": 24,19  "unit_min": 1,20  "unit_max": 10,21  "service_options": {22    "tracking": true,23    "signature_required": true,24    "insurance_available": true25  },26  "delivery_type_id": "uuid",27  "active": true,28  "access_mode": "select_users",29  "user_ids": [30    "user_uuid_1",31    "user_uuid_2"32  ],33  "zone_access_mode": "select_zones",34  "zone_selector_type": "tag",35  "zone_tag_ids": [36    "tag_uuid_1",37    "tag_uuid_2"38  ]39}

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

Request body fields

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

name.arExample
string

Example field from the request body.

name.kuExample
string

Example field from the request body.

codeExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

description.enExample
string

Example field from the request body.

description.arExample
string

Example field from the request body.

description.kuExample
string

Example field from the request body.

image_urlExample
string

Example field from the request body.

priorityExample
number

Example field from the request body.

service_levelExample
string

Example field from the request body.

default_priceExample
number

Example field from the request body.

estimated_delivery_time_minExample
number

Example field from the request body.

estimated_delivery_time_maxExample
number

Example field from the request body.

unit_minExample
number

Example field from the request body.

unit_maxExample
number

Example field from the request body.

service_optionsExample
object

Example field from the request body.

service_options.trackingExample
boolean

Example field from the request body.

service_options.signature_requiredExample
boolean

Example field from the request body.

service_options.insurance_availableExample
boolean

Example field from the request body.

delivery_type_idExample
string

Example field from the request body.

activeExample
boolean

Example field from the request body.

access_modeExample
string

Example field from the request body.

user_idsExample
array<string>

Example field from the request body.

zone_access_modeExample
string

Example field from the request body.

zone_selector_typeExample
string

Example field from the request body.

zone_tag_idsExample
array<string>

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

201 Created201
Response body
json
1{2  "success": true,3  "message": "service_created_successfully",4  "id": "uuid"5}

Update Delivery Service

Delivery & Last-Mile / Delivery Services
PUT/delivery/services/:serviceId?tenant_id=

Update an existing delivery service. Requires manage:operations:tenant permission. Authentication: - Requires valid authentication token with manage:operations:tenant permission Path Parameters: - serviceId: ID of the delivery service to update Query Parameters: - tenant_id (optional): Tenant ID (defaults to authenticated user's tenant) Request Body (all optional): - name (string OR localized object), description (string OR localized object) - image_url (string), priority (integer) - code, service_level, delivery_type_id, default_price, estimated_delivery_time_min/max, unit_min/unit_max, service_options, active - access_mode (all_users|select_users|exclude_users), user_ids - zone_access_mode (all_zones|select_zones|exclude_zones) - zone_selector_type (zone|tag): zone_ids required when zone, zone_tag_ids required when tag Errors: - 404 service_not_found - 404 delivery_type_not_found - 409 service_code_already_exists - 400 invalid_customer_ids - 400 customer_ids_required_for_selected_access_mode - 400 invalid_zone_ids - 400 invalid_zone_tag_ids - 500 internal_server_error

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/delivery/services/:serviceId?tenant_id=" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": {7    "en": "Premium Express 24-Hour Delivery",8    "ar": "...",9    "ku": "..."10  },11  "description": {12    "en": "Updated premium express delivery",13    "ar": "...",14    "ku": "..."15  },16  "image_url": "https://cdn.example.com/tenants/tenant_123/delivery-services/new-icon.png",17  "priority": 5,18  "default_price": 29.99,19  "estimated_delivery_time_min": 10,20  "estimated_delivery_time_max": 24,21  "unit_min": 1,22  "unit_max": 10,23  "service_options": {24    "tracking": true,25    "signature_required": true,26    "insurance_available": true27  },28  "active": true,29  "access_mode": "exclude_users",30  "user_ids": [31    "user_uuid_3"32  ],33  "zone_access_mode": "select_zones",34  "zone_selector_type": "zone",35  "zone_ids": [36    "zone_uuid_1"37  ]38}'
Request body
json
1{2  "name": {3    "en": "Premium Express 24-Hour Delivery",4    "ar": "...",5    "ku": "..."6  },7  "description": {8    "en": "Updated premium express delivery",9    "ar": "...",10    "ku": "..."11  },12  "image_url": "https://cdn.example.com/tenants/tenant_123/delivery-services/new-icon.png",13  "priority": 5,14  "default_price": 29.99,15  "estimated_delivery_time_min": 10,16  "estimated_delivery_time_max": 24,17  "unit_min": 1,18  "unit_max": 10,19  "service_options": {20    "tracking": true,21    "signature_required": true,22    "insurance_available": true23  },24  "active": true,25  "access_mode": "exclude_users",26  "user_ids": [27    "user_uuid_3"28  ],29  "zone_access_mode": "select_zones",30  "zone_selector_type": "zone",31  "zone_ids": [32    "zone_uuid_1"33  ]34}

Path parameters

serviceIdRequired
path string

uuid

ID of the delivery service to update

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

Request body fields

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

name.arExample
string

Example field from the request body.

name.kuExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

description.enExample
string

Example field from the request body.

description.arExample
string

Example field from the request body.

description.kuExample
string

Example field from the request body.

image_urlExample
string

Example field from the request body.

priorityExample
number

Example field from the request body.

default_priceExample
number

Example field from the request body.

estimated_delivery_time_minExample
number

Example field from the request body.

estimated_delivery_time_maxExample
number

Example field from the request body.

unit_minExample
number

Example field from the request body.

unit_maxExample
number

Example field from the request body.

service_optionsExample
object

Example field from the request body.

service_options.trackingExample
boolean

Example field from the request body.

service_options.signature_requiredExample
boolean

Example field from the request body.

service_options.insurance_availableExample
boolean

Example field from the request body.

activeExample
boolean

Example field from the request body.

access_modeExample
string

Example field from the request body.

user_idsExample
array<string>

Example field from the request body.

zone_access_modeExample
string

Example field from the request body.

zone_selector_typeExample
string

Example field from the request body.

zone_idsExample
array<string>

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

200 OK200
Response body
json
1{2  "success": true,3  "message": "service_updated_successfully",4  "deliveryService": {5    "id": "uuid"6  }7}

Get Delivery Service

Delivery & Last-Mile / Delivery Services
GET/delivery/services/:serviceId?tenant_id=&response_type=full

Get a delivery service by ID. Authentication: token required. Query Parameters: - tenant_id (optional): Tenant ID - response_type (optional): basic or full (default: full). Use basic for fast lookups that only need core service fields. Response (full) includes: - name / description (strings, localized to Accept-Language if translations available) - name_translations / description_translations (full JSONB objects for admin edit forms) - image_url (string, nullable) - priority (integer, nullable) - zone_access_mode (all_zones|select_zones|exclude_zones) - zone_selector_type (zone|tag) - zone_ids (array, populated when zone_selector_type=zone) - zones (array of {id, name}, populated when zone_selector_type=zone) - zone_tag_ids (array, populated when zone_selector_type=tag) - zone_tags (array of {id, name}, populated when zone_selector_type=tag) - teams, all_teams (team assignment info) - effective_policy (resolved fulfillment policy) - vehicle_ids, vehicles (vehicle restrictions) Response (basic) includes only the core service record with delivery_type. Responses: - 200 service_retrieved_successfully - 404 service_not_found - 500 internal_server_error

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

Path parameters

serviceIdRequired
path string

uuid

ID of the delivery service

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

response_typeOptional
query string

full

Response detail level: 'basic' (core fields + delivery_type only) or 'full' (includes users, zones, teams, policy, vehicles). Defaults to 'full'.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Delete Delivery Service

Delivery & Last-Mile / Delivery Services
DELETE/delivery/services/:serviceId?tenant_id=

Delete (permanently) a delivery service. Requires manage:operations:tenant permission. Responses: - 200 service_deactivated_successfully - 404 service_not_found - 403 insufficient_permissions - 500 internal_server_error

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

Path parameters

serviceIdRequired
path string

uuid

ID of the delivery service

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.