Exceptions
4 API calls in this section.
List Exceptions
/delivery/exceptions?page=1&limit=10&status=&delivery_id=&driver_id=&exception_type=&sort_by=&sort_order=desc&column_filters=&tenant_id=&language=enList delivery exceptions with pagination, sorting, column filters and stats. Requires manage:operations:tenant or view:tenant permission.
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
pageOptional1
Page number (default: 1)
limitOptional10
Items per page (default: 10)
statusOptionalFilter by exception status (standalone param)
delivery_idOptionalFilter by delivery UUID (standalone param)
driver_idOptionalFilter by driver UUID (standalone param)
exception_typeOptionalFilter by exception type (standalone param)
sort_byOptionalSort column: exception_type | status | created_at (default) | resolved_at
sort_orderOptionaldesc
asc or desc (default: desc)
column_filtersOptionalJSON 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_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Create Exception
/delivery/exceptions?tenant_id=&language=enCreate a new delivery exception. Can be created by either the assigned driver or a user with manage:operations:tenant permission.
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}'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_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
delivery_idExampleExample field from the request body.
driver_idExampleExample field from the request body.
exception_typeExampleExample field from the request body.
statusExampleExample field from the request body.
exception_detailsExampleExample field from the request body.
exception_details.reasonExampleExample field from the request body.
exception_details.severityExampleExample field from the request body.
exception_details.locationExampleExample field from the request body.
exception_details.location.latitudeExampleExample field from the request body.
exception_details.location.longitudeExampleExample field from the request body.
exception_details.location.addressExampleExample field from the request body.
exception_details.delivery_status_at_exceptionExampleExample field from the request body.
exception_details.photosExampleExample field from the request body.
exception_details.photos.urlExampleExample field from the request body.
exception_details.photos.timestampExampleExample field from the request body.
exception_details.photos.captionExampleExample field from the request body.
exception_details.customer_contactedExampleExample field from the request body.
exception_details.customer_contact_methodExampleExample field from the request body.
exception_details.customer_contact_timestampExampleExample field from the request body.
exception_details.customer_responseExampleExample field from the request body.
exception_details.eta_impactExampleExample field from the request body.
notesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Update Exception
/delivery/exceptions/:exceptionId?tenant_id=&language=enUpdate a delivery exception. Only users with manage:operations:tenant permission can update exceptions. When resolving exceptions, resolution_type and resolution_details are required.
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}'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
exceptionIdRequireduuid
ID of the exception to update
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
statusExampleExample field from the request body.
resolution_typeExampleExample field from the request body.
resolution_detailsExampleExample field from the request body.
resolution_details.methodExampleExample field from the request body.
resolution_details.action_takenExampleExample field from the request body.
resolution_details.feedbackExampleExample field from the request body.
resolution_details.feedback.from_customerExampleExample field from the request body.
resolution_details.feedback.from_driverExampleExample field from the request body.
resolution_details.feedback.from_supportExampleExample field from the request body.
resolution_details.process_improvementExampleExample field from the request body.
notesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Get Exception
/delivery/exceptions/:exceptionId?tenant_id=&language=enGet details for a specific delivery exception. Requires manage:operations:tenant or view:tenant permission.
1curl --request GET "$ONDI_BASE_URL/delivery/exceptions/:exceptionId?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
exceptionIdRequireduuid
ID of the exception to retrieve
Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}