Skip to main content

Exceptions

4 API calls in this section.

List Exceptions

Delivery & Last-Mile / Exceptions
GET/delivery/exceptions?page=1&limit=10&status=&delivery_id=&driver_id=&exception_type=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=en

List delivery exceptions with pagination, sorting, column filters and stats. Requires manage:operations:tenant or view:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/exceptions?page=1&limit=10&status=&delivery_id=&driver_id=&exception_type=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number (default: 1)

limitOptional
query string

10

Items per page (default: 10)

statusOptional
query string

Filter by exception status (standalone param)

delivery_idOptional
query string

Filter by delivery UUID (standalone param)

driver_idOptional
query string

Filter by driver UUID (standalone param)

exception_typeOptional
query string

Filter by exception type (standalone param)

sort_byOptional
query string

Sort column: exception_type | status | created_at (default) | resolved_at

sort_orderOptional
query string

desc

asc or desc (default: desc)

column_filtersOptional
query string

JSON object. Keys: exception_type (string), status (string), resolution_type (string), delivery_id (uuid), driver_id (uuid), trigger_point (string, matches exception_details.trigger_point), resolution_trigger_point (string), delivery_code (string substring match), delivery_type (delivery type UUID via deliveries.delivery_service_id -> delivery_services.delivery_type_id), delivery_fee (number or {min,max}), created_at ({from?, to?}). Example: {"delivery_fee":{"min":10,"max":100},"delivery_type":"452ffddf-a8d9-4d16-a5ea-46d16491979c","delivery_code":"123"}

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Insufficient Permissions403Forbidden

Create Exception

Delivery & Last-Mile / Exceptions
POST/delivery/exceptions?tenant_id=&language=en

Create a new delivery exception. Can be created by either the assigned driver or a user with manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/exceptions?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  "delivery_id": "uuid",7  "driver_id": "uuid",8  "exception_type": "address_issue",9  "status": "open",10  "exception_details": {11    "reason": "Address not found",12    "severity": "high",13    "location": {14      "latitude": 37.7749,15      "longitude": -122.4194,16      "address": "123 Invalid Street"17    },18    "delivery_status_at_exception": "in_transit",19    "photos": [20      {21        "url": "https://example.com/photo1.jpg",22        "timestamp": "2023-08-01T14:28:00Z",23        "caption": "Location where address should be"24      }25    ],26    "customer_contacted": true,27    "customer_contact_method": "phone",28    "customer_contact_timestamp": "2023-08-01T14:35:00Z",29    "customer_response": "Will provide updated address",30    "eta_impact": 4531  },32  "notes": "Customer provided incorrect address"33}'
Request body
json
1{2  "delivery_id": "uuid",3  "driver_id": "uuid",4  "exception_type": "address_issue",5  "status": "open",6  "exception_details": {7    "reason": "Address not found",8    "severity": "high",9    "location": {10      "latitude": 37.7749,11      "longitude": -122.4194,12      "address": "123 Invalid Street"13    },14    "delivery_status_at_exception": "in_transit",15    "photos": [16      {17        "url": "https://example.com/photo1.jpg",18        "timestamp": "2023-08-01T14:28:00Z",19        "caption": "Location where address should be"20      }21    ],22    "customer_contacted": true,23    "customer_contact_method": "phone",24    "customer_contact_timestamp": "2023-08-01T14:35:00Z",25    "customer_response": "Will provide updated address",26    "eta_impact": 4527  },28  "notes": "Customer provided incorrect address"29}

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

delivery_idExample
string

Example field from the request body.

driver_idExample
string

Example field from the request body.

exception_typeExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

exception_detailsExample
object

Example field from the request body.

exception_details.reasonExample
string

Example field from the request body.

exception_details.severityExample
string

Example field from the request body.

exception_details.locationExample
object

Example field from the request body.

exception_details.location.latitudeExample
number

Example field from the request body.

exception_details.location.longitudeExample
number

Example field from the request body.

exception_details.location.addressExample
string

Example field from the request body.

exception_details.delivery_status_at_exceptionExample
string

Example field from the request body.

exception_details.photosExample
array<object>

Example field from the request body.

exception_details.photos.urlExample
string

Example field from the request body.

exception_details.photos.timestampExample
string

Example field from the request body.

exception_details.photos.captionExample
string

Example field from the request body.

exception_details.customer_contactedExample
boolean

Example field from the request body.

exception_details.customer_contact_methodExample
string

Example field from the request body.

exception_details.customer_contact_timestampExample
string

Example field from the request body.

exception_details.customer_responseExample
string

Example field from the request body.

exception_details.eta_impactExample
number

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created
Error - Missing Required Field400Bad Request
Error - Delivery Not Found404Not Found

Update Exception

Delivery & Last-Mile / Exceptions
PUT/delivery/exceptions/:exceptionId?tenant_id=&language=en

Update a delivery exception. Only users with manage:operations:tenant permission can update exceptions. When resolving exceptions, resolution_type and resolution_details are required.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/delivery/exceptions/:exceptionId?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  "status": "resolved",7  "resolution_type": "delivered",8  "resolution_details": {9    "method": "customer_provided_correct_address",10    "action_taken": "Driver delivered to the corrected address",11    "feedback": {12      "from_customer": "Thanks for the effort",13      "from_driver": "Address was difficult to find",14      "from_support": "Customer has updated their address in the system"15    },16    "process_improvement": "Add address verification step during order placement"17  },18  "notes": "Successfully resolved after customer provided correct address"19}'
Request body
json
1{2  "status": "resolved",3  "resolution_type": "delivered",4  "resolution_details": {5    "method": "customer_provided_correct_address",6    "action_taken": "Driver delivered to the corrected address",7    "feedback": {8      "from_customer": "Thanks for the effort",9      "from_driver": "Address was difficult to find",10      "from_support": "Customer has updated their address in the system"11    },12    "process_improvement": "Add address verification step during order placement"13  },14  "notes": "Successfully resolved after customer provided correct address"15}

Path parameters

exceptionIdRequired
path string

uuid

ID of the exception 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

statusExample
string

Example field from the request body.

resolution_typeExample
string

Example field from the request body.

resolution_detailsExample
object

Example field from the request body.

resolution_details.methodExample
string

Example field from the request body.

resolution_details.action_takenExample
string

Example field from the request body.

resolution_details.feedbackExample
object

Example field from the request body.

resolution_details.feedback.from_customerExample
string

Example field from the request body.

resolution_details.feedback.from_driverExample
string

Example field from the request body.

resolution_details.feedback.from_supportExample
string

Example field from the request body.

resolution_details.process_improvementExample
string

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Error - Resolution Details Required400Bad Request
Error - Cannot Reopen Resolved Exception400Bad Request

Get Exception

Delivery & Last-Mile / Exceptions
GET/delivery/exceptions/:exceptionId?tenant_id=&language=en

Get details for a specific delivery exception. Requires manage:operations:tenant or view:tenant permission.

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

Path parameters

exceptionIdRequired
path string

uuid

ID of the exception 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 - Exception Not Found404Not Found
Error - Insufficient Permissions403Forbidden
Error - Tenant Not Found404Not Found