Skip to main content

Error Scenarios

14 API calls in this section.

Collection of error scenarios and edge cases for testing the Route Calculation API.

Unauthorized Access​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Test unauthorized access without authentication token.

Expected Response

  • Status: 401 Unauthorized

  • Message: Authentication required

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2  --header "Content-Type: application/json" \3  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

401Unauthorized
Response body
json
1{2  "success": false,3  "message": "Authentication required"4}

Invalid Driver ID​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/invalid-uuid/delivery/{{delivery_id}}

Test with invalid driver ID format.

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid driver ID format

Path parameters

ParameterTypeDescription
delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/invalid-uuid/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid driver ID format"4}

Invalid Delivery ID​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/invalid-uuid

Test with invalid delivery ID format.

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid delivery ID format

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/invalid-uuid" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid delivery ID format"4}

Invalid Coordinates​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Test with invalid coordinate values (out of valid range).

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid coordinates

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Query parameters

ParameterTypeDescription
current_latstring

Invalid latitude (out of range)

Example: 91

current_lngstring

Invalid longitude (out of range)

Example: 181

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}?current_lat=91&current_lng=181" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid coordinates"4}

Driver Not Found​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/{{delivery_id}}

Test with non-existent driver ID.

Expected Response

  • Status: 404 Not Found

  • Message: Driver not found

Path parameters

ParameterTypeDescription
delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

404Not Found
Response body
json
1{2  "success": false,3  "message": "Driver not found"4}

Delivery Not Found​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/00000000-0000-0000-0000-000000000000

Test with non-existent delivery ID.

Expected Response

  • Status: 404 Not Found

  • Message: Delivery not found

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/00000000-0000-0000-0000-000000000000" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

404Not Found
Response body
json
1{2  "success": false,3  "message": "Delivery not found"4}

Google Maps API Error​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Simulate Google Maps API error scenarios (when API key is invalid, quota exceeded, etc.).

No-route contract

Google Maps ZERO_RESULTS returns HTTP 404 with stable code=no_route_found and a localized plain-language message; it is not an internal server error. Frontends should display message, may branch on code, and should not retry the same coordinates as a server failure. The driver and delivery IDs remain unchanged and no navigation action is required.

Other possible error responses

  • API quota exceeded

  • Invalid API key

  • Location not found

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

500Internal Server Error
Response body
json
1{2  "success": false,3  "message": "API quota exceeded"4}

Unauthorized Access​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Test unauthorized access without authentication token.

Expected Response

  • Status: 401 Unauthorized

  • Message: Authentication required

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2  --header "Content-Type: application/json" \3  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

401Unauthorized
Response body
json
1{2  "success": false,3  "message": "Authentication required"4}

Invalid Driver ID​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/invalid-uuid/delivery/{{delivery_id}}

Test with invalid driver ID format.

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid driver ID format

Path parameters

ParameterTypeDescription
delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/invalid-uuid/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid driver ID format"4}

Invalid Delivery ID​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/invalid-uuid

Test with invalid delivery ID format.

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid delivery ID format

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/invalid-uuid" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid delivery ID format"4}

Invalid Coordinates​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Test with invalid coordinate values (out of valid range).

Expected Response

  • Status: 400 Bad Request

  • Message: Invalid coordinates

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Query parameters

ParameterTypeDescription
current_latstring

Invalid latitude (out of range)

Example: 91

current_lngstring

Invalid longitude (out of range)

Example: 181

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}?current_lat=91&current_lng=181" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

400Bad Request
Response body
json
1{2  "success": false,3  "message": "Invalid coordinates"4}

Driver Not Found​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/{{delivery_id}}

Test with non-existent driver ID.

Expected Response

  • Status: 404 Not Found

  • Message: Driver not found

Path parameters

ParameterTypeDescription
delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

404Not Found
Response body
json
1{2  "success": false,3  "message": "Driver not found"4}

Delivery Not Found​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/00000000-0000-0000-0000-000000000000

Test with non-existent delivery ID.

Expected Response

  • Status: 404 Not Found

  • Message: Delivery not found

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/00000000-0000-0000-0000-000000000000" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

404Not Found
Response body
json
1{2  "success": false,3  "message": "Delivery not found"4}

Google Maps API Error​

Delivery & Last-Mile / Error Scenarios
GET/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}

Simulate Google Maps API error scenarios (when API key is invalid, quota exceeded, etc.).

No-route contract

Google Maps ZERO_RESULTS returns HTTP 404 with stable code=no_route_found and a localized plain-language message; it is not an internal server error. Frontends should display message, may branch on code, and should not retry the same coordinates as a server failure. The driver and delivery IDs remain unchanged and no navigation action is required.

Other possible error responses

  • API quota exceeded

  • Invalid API key

  • Location not found

Path parameters

ParameterTypeDescription
driver_idRequiredstring

Variable used inside the request path.

delivery_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

500Internal Server Error
Response body
json
1{2  "success": false,3  "message": "API quota exceeded"4}