# Error Handling

## Error Response Format

All error responses follow the same JSON structure:

```json
{
  "status": false,
  "status_code": 422,
  "message": "VALIDATION_ERROR",
  "errors": {
    "email": ["The email field is required."],
    "password": ["The password must be at least 8 characters."]
  }
}
```

| Field        | Type            | Descriptio                                                |
| ------------ | --------------- | --------------------------------------------------------- |
| status       | boolean         | Always `false` in case of an error.                       |
| status\_code | integer         | Standard HTTP status code                                 |
| message      | string          | Machine-readable error type or message.                   |
| errors       | array or object | Detailed error info (validation errors, system messages). |

## Common Error Types

| HTTP Code | Message                 | Description                                              |
| --------- | ----------------------- | -------------------------------------------------------- |
| 400       | INTERNAL\_SERVER\_ERROR | Unexpected. server-side or integration error.            |
| 401       | UNAUTHORIZED            | Invalid or missing API token.                            |
| 403       | NO\_PERMISSION          | Authenticated but not authorized to access the resource. |
| 404       | NOT\_FOUND              | Resource or endpoint not found.                          |
| 422       | VALIDATION\_ERROR       | Request failed input validation.                         |
| 429       | Too Many Attempts.      | Rate limit exceeded.                                     |
| 500       | INTERNAL\_SERVER\_ERROR | Unhandled internal error.                                |

{% hint style="info" %}
**Important:**  API responses reflect only the technical outcome of a request and do not represent the final business state of a payment. The authoritative and final payment status is delivered through the webhook event and should be treated as the source of truth.

More information about webhook events statuses can be found here: [Transaction Event | Documentation](/webhooks/events/transaction-event.md)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.gurupay.eu/getting-started/api-concepts/error-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
