Delivery Services
5 API calls in this section.
List Delivery Services
/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
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
pageOptional1
Page number for pagination
limitOptional10
Number of items per page
service_levelOptionalFilter by service level (economy, standard, express, same_day, next_day, scheduled)
activeOptionaltrue
Filter by active status (true/false)
delivery_typeOptionalFilter by delivery_type_id (UUID)
delivery_type_codeOptionalFilter by delivery_type.code
searchOptionalSearch by name or code (ilike)
price_orderOptionalOrder by default_price (asc/desc)
column_filtersOptional{"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_byOptionalcreated_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_orderOptionaldesc
Sort direction (asc|desc). Defaults to desc.
tenant_idOptionalTenant ID (defaults to authenticated user's tenant)
customer_idOptionalFilter 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
AuthorizationOptionalBearer {{access_token}}
Responses
Create Delivery Service
/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
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}'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_idOptionalTenant ID (optional if in auth token)
Request body fields
nameExampleExample field from the request body.
name.enExampleExample field from the request body.
name.arExampleExample field from the request body.
name.kuExampleExample field from the request body.
codeExampleExample field from the request body.
descriptionExampleExample field from the request body.
description.enExampleExample field from the request body.
description.arExampleExample field from the request body.
description.kuExampleExample field from the request body.
image_urlExampleExample field from the request body.
priorityExampleExample field from the request body.
service_levelExampleExample field from the request body.
default_priceExampleExample field from the request body.
estimated_delivery_time_minExampleExample field from the request body.
estimated_delivery_time_maxExampleExample field from the request body.
unit_minExampleExample field from the request body.
unit_maxExampleExample field from the request body.
service_optionsExampleExample field from the request body.
service_options.trackingExampleExample field from the request body.
service_options.signature_requiredExampleExample field from the request body.
service_options.insurance_availableExampleExample field from the request body.
delivery_type_idExampleExample field from the request body.
activeExampleExample field from the request body.
access_modeExampleExample field from the request body.
user_idsExampleExample field from the request body.
zone_access_modeExampleExample field from the request body.
zone_selector_typeExampleExample field from the request body.
zone_tag_idsExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "service_created_successfully",4 "id": "uuid"5}Update Delivery Service
/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
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}'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
serviceIdRequireduuid
ID of the delivery service to update
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
Request body fields
nameExampleExample field from the request body.
name.enExampleExample field from the request body.
name.arExampleExample field from the request body.
name.kuExampleExample field from the request body.
descriptionExampleExample field from the request body.
description.enExampleExample field from the request body.
description.arExampleExample field from the request body.
description.kuExampleExample field from the request body.
image_urlExampleExample field from the request body.
priorityExampleExample field from the request body.
default_priceExampleExample field from the request body.
estimated_delivery_time_minExampleExample field from the request body.
estimated_delivery_time_maxExampleExample field from the request body.
unit_minExampleExample field from the request body.
unit_maxExampleExample field from the request body.
service_optionsExampleExample field from the request body.
service_options.trackingExampleExample field from the request body.
service_options.signature_requiredExampleExample field from the request body.
service_options.insurance_availableExampleExample field from the request body.
activeExampleExample field from the request body.
access_modeExampleExample field from the request body.
user_idsExampleExample field from the request body.
zone_access_modeExampleExample field from the request body.
zone_selector_typeExampleExample field from the request body.
zone_idsExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "service_updated_successfully",4 "deliveryService": {5 "id": "uuid"6 }7}Get Delivery Service
/delivery/services/:serviceId?tenant_id=&response_type=fullGet 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
1curl --request GET "$ONDI_BASE_URL/delivery/services/:serviceId?tenant_id=&response_type=full" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
serviceIdRequireduuid
ID of the delivery service
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
response_typeOptionalfull
Response detail level: 'basic' (core fields + delivery_type only) or 'full' (includes users, zones, teams, policy, vehicles). Defaults to 'full'.
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Delete Delivery Service
/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
1curl --request DELETE "$ONDI_BASE_URL/delivery/services/:serviceId?tenant_id=" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
serviceIdRequireduuid
ID of the delivery service
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.