Service Fulfillment Policies
7 API calls in this section.
CRUD for delivery service fulfillment policy profiles. proof_settings has five independent stages: driver_pickup, client_pickup, driver_delivery, warehouse_pickup, and warehouse_delivery. Each stage accepts photo_required and signature_required. payment_policies.refund_delivery_fee_on_cancel and payment_policies.refund_delivery_fee_on_return control whether a collected delivery fee is credited to the sender wallet for whole-order cancellation or return. Defaults are Cancel = refund (true) and Return = no refund (false). COD settlement is independent. Driver delivery flows enforce driver_pickup for non-warehouse pickup endpoints, warehouse_pickup for warehouse pickup endpoints, driver_delivery for non-warehouse delivery endpoints, and warehouse_delivery for warehouse delivery endpoints.
Get Tenant Default Policy
/delivery/tenant-default-policyReturns data.effective with all inherited policy values and data.tenant_overrides with the explicitly stored tenant setting. Effective payment defaults are refund_delivery_fee_on_cancel=true and refund_delivery_fee_on_return=false.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/tenant-default-policy?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "data": {4 "effective": {5 "payment_policies": {6 "allow_cod_on_replacement": true,7 "refund_delivery_fee_on_cancel": true,8 "refund_delivery_fee_on_return": false9 }10 },11 "tenant_overrides": null12 }13}Update Tenant Default Policy
/delivery/tenant-default-policyStores tenant-level defaults. Both refund fields are booleans. Service policy profiles and custom service overrides may override them per service. Invalid types return HTTP 400 with localized validation_error and a field-specific detail.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
payment_policies | object | — |
payment_policies.allow_cod_on_replacement | boolean | — |
payment_policies.refund_delivery_fee_on_cancel | boolean | — |
payment_policies.refund_delivery_fee_on_return | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/tenant-default-policy?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "payment_policies": {6 "allow_cod_on_replacement": true,7 "refund_delivery_fee_on_cancel": true,8 "refund_delivery_fee_on_return": false9 }10}'Response examples
1{2 "success": true,3 "message": "Tenant default policy updated successfully",4 "data": {5 "payment_policies": {6 "allow_cod_on_replacement": true,7 "refund_delivery_fee_on_cancel": true,8 "refund_delivery_fee_on_return": false9 }10 }11}List Fulfillment Policies
/delivery/service-policy-profilesBrowse the tenant’s reusable fulfillment policies, including assignment, proof and payment settings.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/service-policy-profiles?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "policies": [4 {5 "id": "uuid",6 "name": "Express Policy",7 "assignment_mode": "automatic",8 "proof_settings": {9 "driver_pickup": {10 "photo_required": false,11 "signature_required": false12 },13 "client_pickup": {14 "photo_required": false,15 "signature_required": false16 },17 "driver_delivery": {18 "photo_required": true,19 "signature_required": true20 },21 "warehouse_pickup": {22 "photo_required": false,23 "signature_required": false24 },25 "warehouse_delivery": {26 "photo_required": false,27 "signature_required": false28 }29 },30 "active": true,31 "created_at": "2025-01-01T00:00:00Z",32 "updated_at": "2025-01-01T00:00:00Z"33 }34 ],35 "total": 1,36 "pagination": {37 "page": 1,38 "limit": 20,39 "total": 1,40 "total_pages": 141 }42}Get Fulfillment Policy
/delivery/service-policy-profiles/:idRead one tenant fulfillment policy and its linked delivery services before changing the policy’s rules.
Path parameters
| Parameter | Type | Description |
|---|---|---|
idRequired | string | Fulfillment policy profile UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/service-policy-profiles/${ID}?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "policy": {4 "id": "uuid",5 "tenant_id": "uuid",6 "name": "Express Policy",7 "assignment_mode": "automatic",8 "proof_settings": {9 "driver_pickup": {10 "photo_required": false,11 "signature_required": false12 },13 "client_pickup": {14 "photo_required": false,15 "signature_required": false16 },17 "driver_delivery": {18 "photo_required": true,19 "signature_required": true20 },21 "warehouse_pickup": {22 "photo_required": false,23 "signature_required": false24 },25 "warehouse_delivery": {26 "photo_required": false,27 "signature_required": false28 }29 },30 "active": true,31 "created_at": "2025-01-01T00:00:00Z",32 "updated_at": "2025-01-01T00:00:00Z"33 },34 "linked_services": []35}Create Fulfillment Policy
/delivery/service-policy-profilesSave a reusable set of assignment, proof-of-delivery and payment rules for delivery services.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
assignment_mode | string | — |
proof_settings | object | — |
proof_settings.driver_pickup | object | — |
proof_settings.driver_pickup.photo_required | boolean | — |
proof_settings.driver_pickup.signature_required | boolean | — |
proof_settings.client_pickup | object | — |
proof_settings.client_pickup.photo_required | boolean | — |
proof_settings.client_pickup.signature_required | boolean | — |
proof_settings.driver_delivery | object | — |
proof_settings.driver_delivery.photo_required | boolean | — |
proof_settings.driver_delivery.signature_required | boolean | — |
Show 10 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
proof_settings.warehouse_pickup | object | — |
proof_settings.warehouse_pickup.photo_required | boolean | — |
proof_settings.warehouse_pickup.signature_required | boolean | — |
proof_settings.warehouse_delivery | object | — |
proof_settings.warehouse_delivery.photo_required | boolean | — |
proof_settings.warehouse_delivery.signature_required | boolean | — |
payment_policies | object | — |
payment_policies.allow_cod_on_replacement | boolean | — |
payment_policies.refund_delivery_fee_on_cancel | boolean | — |
payment_policies.refund_delivery_fee_on_return | boolean | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/service-policy-profiles?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Express Policy",6 "assignment_mode": "automatic",7 "proof_settings": {8 "driver_pickup": {9 "photo_required": false,10 "signature_required": false11 },12 "client_pickup": {13 "photo_required": false,14 "signature_required": false15 },16 "driver_delivery": {17 "photo_required": true,18 "signature_required": true19 },20 "warehouse_pickup": {21 "photo_required": false,22 "signature_required": false23 },24 "warehouse_delivery": {25 "photo_required": false,26 "signature_required": false27 }28 },29 "payment_policies": {30 "allow_cod_on_replacement": true,31 "refund_delivery_fee_on_cancel": true,32 "refund_delivery_fee_on_return": false33 }34}'Response examples
1{2 "success": true,3 "policy": {4 "id": "uuid",5 "tenant_id": "uuid",6 "name": "Express Policy",7 "assignment_mode": "automatic",8 "proof_settings": {9 "driver_pickup": {10 "photo_required": false,11 "signature_required": false12 },13 "client_pickup": {14 "photo_required": false,15 "signature_required": false16 },17 "driver_delivery": {18 "photo_required": true,19 "signature_required": true20 },21 "warehouse_pickup": {22 "photo_required": false,23 "signature_required": false24 },25 "warehouse_delivery": {26 "photo_required": false,27 "signature_required": false28 }29 },30 "active": true,31 "created_at": "2025-01-01T00:00:00Z",32 "updated_at": "2025-01-01T00:00:00Z"33 }34}Update Fulfillment Policy
/delivery/service-policy-profiles/:idChange the name or fulfillment rules of an existing policy.
Path parameters
| Parameter | Type | Description |
|---|---|---|
idRequired | string | Fulfillment policy profile UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
proof_settings | object | — |
proof_settings.driver_pickup | object | — |
proof_settings.driver_pickup.photo_required | boolean | — |
proof_settings.driver_pickup.signature_required | boolean | — |
proof_settings.warehouse_delivery | object | — |
proof_settings.warehouse_delivery.photo_required | boolean | — |
proof_settings.warehouse_delivery.signature_required | boolean | — |
payment_policies | object | — |
payment_policies.allow_cod_on_replacement | boolean | — |
payment_policies.refund_delivery_fee_on_cancel | boolean | — |
payment_policies.refund_delivery_fee_on_return | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/service-policy-profiles/${ID}?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Updated Express Policy",6 "proof_settings": {7 "driver_pickup": {8 "photo_required": true,9 "signature_required": true10 },11 "warehouse_delivery": {12 "photo_required": false,13 "signature_required": false14 }15 },16 "payment_policies": {17 "allow_cod_on_replacement": true,18 "refund_delivery_fee_on_cancel": true,19 "refund_delivery_fee_on_return": true20 }21}'Response examples
1{2 "success": true,3 "policy": {4 "id": "uuid",5 "tenant_id": "uuid",6 "name": "Express Policy",7 "assignment_mode": "automatic",8 "proof_settings": {9 "driver_pickup": {10 "photo_required": false,11 "signature_required": false12 },13 "client_pickup": {14 "photo_required": false,15 "signature_required": false16 },17 "driver_delivery": {18 "photo_required": true,19 "signature_required": true20 },21 "warehouse_pickup": {22 "photo_required": false,23 "signature_required": false24 },25 "warehouse_delivery": {26 "photo_required": false,27 "signature_required": false28 }29 },30 "active": true,31 "created_at": "2025-01-01T00:00:00Z",32 "updated_at": "2025-01-01T00:00:00Z"33 }34}Delete (Deactivate) Fulfillment Policy
/delivery/service-policy-profiles/:idDeactivate a fulfillment policy. A policy still used by a service cannot be deactivated.
Path parameters
| Parameter | Type | Description |
|---|---|---|
idRequired | string | Fulfillment policy profile UUID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Example: |
language | string | Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/service-policy-profiles/${ID}?tenant_id=${TENANT_ID}&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "deactivated"4}