> For the complete documentation index, see [llms.txt](https://docs.ecommerce.seb.ee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecommerce.seb.ee/integration/merchant-api/response-handling/error-codes.md).

# Error Codes

When a request cannot be processed successfully, the API returns an appropriate HTTP status code together with an error code describing the specific reason for the failure. The following table lists the possible error responses and their meanings.

| HTTP Status               | Error Code                                                                                                                              | Description                                                                                                                                                    |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400` Bad Request         | `FORMAT_ERROR`                                                                                                                          | The request contains invalid, malformed, or missing required data.                                                                                             |
| `400` Bad Request         | `AMOUNT_EXCEEDED`                                                                                                                       | The requested refund amount exceeds the available refundable amount.                                                                                           |
| `401` Unauthorized        | `TOKEN_UNKNOWN`, `TOKEN_EXPIRED`                                                                                                        | Authentication failed because the access token is missing, invalid, or expired.                                                                                |
| `403` Forbidden           | `OPERATION_NOT_ALLOWED`                                                                                                                 | The requested operation is not permitted due to business rules or account restrictions.                                                                        |
| `403` Forbidden           | `PAYMENT_METHOD_INVALID`                                                                                                                | The selected payment method is not available for the shop                                                                                                      |
| `404` Not Found           | `RESOURCE_UNKNOWN`, `PAYMENT_UNKNOWN`, `SESSION_UNKNOWN`, `GATEWAY_TOKEN_UNKNOWN`, `REFUND_UNKNOWN`, `MERCHANT_UNKNOWN`, `SHOP_UNKNOWN` | The requested resource does not exist.                                                                                                                         |
| `409` Conflict            | `STATUS_INVALID`                                                                                                                        | The requested operation is not allowed in the current state of the resource. For example, attempting to capture a payment that has been refunded, or canceled. |
| `429` Too Many Requests   | `OPERATION_NOT_ALLOWED`                                                                                                                 | The request rate limit has been exceeded. Retry the request later.                                                                                             |
| `503` Service Unavailable | `INTERNAL_SERVER_ERROR`                                                                                                                 | The request could not be processed due to a temporary service interruption or internal system error.                                                           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecommerce.seb.ee/integration/merchant-api/response-handling/error-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
