# API Errors

Here are listed the HTTP status codes indicating that an error occurred while making a request to the QR MIA API, along with possible solutions.\
If you encounter errors or uncertainties during integration or testing, please consult the API documentation and, if needed, contact the technical support team.\
For efficient analysis, please provide the following details:

* HTTP status code
* `errorCode`
* `errorMessage`
* Exact date and time of the request
* Information about the integrated solution (Project ID, Merchant name, Application/Website name, Website URL)

#### Error format

```
{
  "errors": [
    {
      "errorCode": "14005",
      "errorMessage": "QR {{qrId}} is already cancelled.",
      "errorArgs": {
        "qrId": "123456789"
      }
    }
  ],
  "ok": false
}
```

#### API Errors

| Error Code | Error name                     | Message                                                                                                                    | Parameters         | HTTP Code |
| ---------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------ | --------- |
| `10000`    | `maib.merchant.payments-10000` | Internal error encountered. Please try again or report if error persists.                                                  | –                  | 500       |
| `11000`    | `maib.merchant.payments-11000` | Invalid credentials. Please check 'clientId' and 'clientSecret'.                                                           | –                  | 401       |
| `12000`    | `maib.merchant.payments-12000` | Parameter `{{parameter}}` is invalid.                                                                                      | `parameter`        | –         |
| `12001`    | `maib.merchant.payments-12001` | Provided request is invalid: `{{error}}`.                                                                                  | `error`            | –         |
| `12002`    | `maib.merchant.payments-12002` | Currency `{{currency}}` is invalid.                                                                                        | `currency`         | –         |
| `12003`    | `maib.merchant.payments-12003` | Sorting options are invalid.                                                                                               | –                  | –         |
| `12004`    | `maib.merchant.payments-12004` | QR type `{{actualValue}}` is invalid.                                                                                      | `actualValue`      | –         |
| `12005`    | `maib.merchant.payments-12005` | QR status `{{actualValue}}` is invalid.                                                                                    | `actualValue`      | –         |
| `12006`    | `maib.merchant.payments-12006` | 'expiresAt' field must be in future. Provided value: `{{actualValue}}`.                                                    | `actualValue`      | –         |
| `12007`    | `maib.merchant.payments-12007` | Please provide 'clientId' and 'clientSecret'.                                                                              | –                  | –         |
| `13000`    | `maib.merchant.payments-13000` | QR `{{qrId}}` is not found.                                                                                                | `qrId`             | 404       |
| `14000`    | `maib.merchant.payments-14000` | Merchant is not active.                                                                                                    | –                  | 409       |
| `14001`    | `maib.merchant.payments-14001` | 'expiresAt' field must be in future.                                                                                       | –                  | 409       |
| `14002`    | `maib.merchant.payments-14002` | MIA MCC is not set.                                                                                                        | –                  | 409       |
| `14003`    | `maib.merchant.payments-14003` | MIA payment `{{miaPaymentId}}` is not found.                                                                               | `miaPaymentId`     | 409       |
| `14004`    | `maib.merchant.payments-14004` | Merchant `{{merchantId}}` has no default MIA account set.                                                                  | `merchantId`       | 409       |
| `14005`    | `maib.merchant.payments-14005` | QR `{{qrId}}` is already cancelled.                                                                                        | `qrId`             | 409       |
| `14006`    | `maib.merchant.payments-14006` | QR code type `{{type}}` is invalid.                                                                                        | `type`             | 409       |
| `14007`    | `maib.merchant.payments-14007` | QR code with a Fixed amount type must have amount set.                                                                     | –                  | 409       |
| `14008`    | `maib.merchant.payments-14008` | QR code with a Controlled amount type must have min or max amount set.                                                     | –                  | 409       |
| `14009`    | `maib.merchant.payments-14009` | Account is not active.                                                                                                     | –                  | 409       |
| `14010`    | `maib.merchant.payments-14010` | MIA payment is not found by QR id `{{qrId}}`.                                                                              | `qrId`             | 404       |
| `14011`    | `maib.merchant.payments-14011` | MIA payment is not found by RRN `{{rrn}}`.                                                                                 | `rrn`              | 404       |
| `14012`    | `maib.merchant.payments-14012` | MIA payment is not found by MIA message id `{{miaMessageId}}`.                                                             | `miaMessageId`     | 404       |
| `14013`    | `maib.merchant.payments-14013` | Auto-refund is only allowed for dynamic QRs.                                                                               | –                  | 409       |
| `14014`    | `maib.merchant.payments-14014` | Only direct operations can be refunded.                                                                                    | –                  | 409       |
| `14015`    | `maib.merchant.payments-14015` | MIA payment `{{paymentId}}` is already refunded.                                                                           | `paymentId`        | 409       |
| `14016`    | `maib.merchant.payments-14016` | Cannot refund MIA payment for provided amount `{{refundableAmount}}`. Available refundable amount: `{{refundableAmount}}`. | `refundableAmount` | 404       |
| `14017`    | `maib.merchant.payments-14017` | Cannot determine MIA commission percent for MCC `{mcc}`.                                                                   | `mcc`              | 404       |
| `14018`    | `maib.merchant.payments-14018` | Merchant not found by Account Number `{accountNumber}`.                                                                    | `accountNumber`    | 404       |
| `14019`    | `maib.merchant.payments-14019` | QR code's state does not allow this operation: `{state}`.                                                                  | `state`            | 409       |


---

# 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://docs.maibmerchants.md/mia-qr-api/en/errors/api-errors.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.
