Errors & codes

Errors & codes

Response format

Success

1{
2 "statusCode": 200,
3 "data": {},
4 "message": "Success",
5 "success": true
6}

Error

1{
2 "statusCode": 400,
3 "success": false,
4 "message": "Validation error.",
5 "errors": {
6 "code": "VALIDATION_ERROR",
7 "details": "..."
8 }
9}

HTTP statuses

HTTPMeaning
200Success
201Order created
400Validation or business rule error
401Missing or invalid x-api-key
404Ride not found
500Server error

Business codes

CodeEndpointMeaning
FARE_CALCULATEDFare estimateFare quotes returned
RIDE_CREATEDCreate orderOrder created
USER_HAVE_ACTIVE_RIDECreate orderRider already has an active ride
WEBHOOK_REQUIREDCreate orderwebhookURL was not provided
VALIDATION_ERRORAnyInvalid request body
RIDE_CANCELLEDCancelRide cancelled
RIDE_NOT_FOUNDCancel / feedbackUnknown orderId
RIDE_NOT_CANCELLABLECancelRide cannot be cancelled in its current state
FEEDBACK_SUBMITTEDFeedbackFeedback saved
SERVER_ERRORAnyUnexpected failure

Active ride rule

A rider can have only one active ride at a time. Create order returns USER_HAVE_ACTIVE_RIDE when an active ride already exists.