> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.feryrides.co.in/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.feryrides.co.in/_mcp/server.

# Errors & codes

> HTTP statuses and response codes returned by Fery

# Errors & codes

## Response format

### Success

```json
{
  "statusCode": 200,
  "data": {},
  "message": "Success",
  "success": true
}
```

### Error

```json
{
  "statusCode": 400,
  "success": false,
  "message": "Validation error.",
  "errors": {
    "code": "VALIDATION_ERROR",
    "details": "..."
  }
}
```

## HTTP statuses

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

## Business codes

| Code                    | Endpoint          | Meaning                                       |
| ----------------------- | ----------------- | --------------------------------------------- |
| `FARE_CALCULATED`       | Fare estimate     | Fare quotes returned                          |
| `RIDE_CREATED`          | Create order      | Order created                                 |
| `USER_HAVE_ACTIVE_RIDE` | Create order      | Rider already has an active ride              |
| `WEBHOOK_REQUIRED`      | Create order      | `webhookURL` was not provided                 |
| `VALIDATION_ERROR`      | Any               | Invalid request body                          |
| `RIDE_CANCELLED`        | Cancel            | Ride cancelled                                |
| `RIDE_NOT_FOUND`        | Cancel / feedback | Unknown `orderId`                             |
| `RIDE_NOT_CANCELLABLE`  | Cancel            | Ride cannot be cancelled in its current state |
| `FEEDBACK_SUBMITTED`    | Feedback          | Feedback saved                                |
| `SERVER_ERROR`          | Any               | Unexpected 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.