> For the complete documentation index, see [llms.txt](https://piqpay.gitbook.io/merchant-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piqpay.gitbook.io/merchant-integration/additional-information/api-errors.md). Agents can also search and read this documentation through its [MCP server](https://piqpay.gitbook.io/merchant-integration/~gitbook/mcp).

# API errors

| Http status code | Error text                                                                  | Error description                                                                                                                                                                                                 | Error code          |
| ---------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| 500              | Something went wrong. Unhandled server error.                               | <ul><li>Invalid/inactive API key in the request body, </li><li>merchant not ACTIVE, </li><li>incorrect URL in "callbackUrl" ("redirectUrl", "failureUrl", "cancelUrl"), </li><li>other unhandled errors</li></ul> | 0                   |
| 401              | Unauthorized action is forbidden. Something is wrong with the api key.      | <ul><li>Missing or empty Authorization: Bearer token (secretKey), </li><li>invalid secretKey, </li><li>API key in TERMINATED status; </li><li>IP not in allowed\_ips list (if whitelist is configured)</li></ul>  | 1                   |
| 403              | Requested action is forbidden. Something is wrong with api key permissions. | There are permission issues with the specified API key. For example, an `sk_prod_` key from one merchant and a `pk_prod_` key from another merchant.                                                              | 3                   |
| 404              | Requested resource is not found.                                            | <ul><li>The deposit/withdrawal amount (minorAmount) is below/above the limit. </li><li>Additional merchant account settings are required.</li></ul>                                                               | 4                   |
| 400              | Customer client is suspended. BadRequest                                    | <ul><li>The user with the specified client ID has been blocked. </li><li>Unsupported payment method. Broken JSON, invalid fields.</li></ul>                                                                       | 60037, 60031, 12, 2 |
| 409              | Payment/payout already exists for merchant and client id.                   | Deposit/withdrawal for the specified client ID already exists                                                                                                                                                     | 60033, 60036        |
