> ## Documentation Index
> Fetch the complete documentation index at: https://chariow.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> API error codes and handling

The Chariow API uses conventional HTTP response codes to indicate success or failure.

## HTTP Status Codes

| Code | Description      |
| ---- | ---------------- |
| 200  | Success          |
| 201  | Created          |
| 400  | Bad Request      |
| 401  | Unauthorised     |
| 403  | Forbidden        |
| 404  | Not Found        |
| 422  | Validation Error |
| 429  | Rate Limited     |
| 500  | Server Error     |

## Error Response Format

```json theme={null}
{
  "message": "Error description",
  "data": [],
  "errors": {
    "field_name": ["Validation error message"]
  }
}
```

## Common Errors

### Validation Error (422)

```json theme={null}
{
  "message": "The given data was invalid.",
  "data": [],
  "errors": {
    "email": ["The email field is required."],
    "product_id": ["The selected product_id is invalid."]
  }
}
```

### Not Found (404)

```json theme={null}
{
  "message": "No query results for model [App\\Models\\Product].",
  "data": [],
  "errors": []
}
```

### Rate Limited (429)

```json theme={null}
{
  "message": "Rate limit exceeded. Please retry after 60 seconds.",
  "data": [],
  "errors": []
}
```
