# Erori API

Aici sunt enumerate toate posibilele erori care pot fi primite ca răspuns în timpul request-urilor către API-ul QR MIA.

În cazul în care în timpul integrării/testării vă întâlniți cu erori sau neclarități, vă rugăm să consultați mai detaliat documentația API sau să contactați echipa de suport, furnizând cât mai multe date legate de eroare (HTTP status code, errorCode, errorMessage, data/ora/minuta/secunda request-ului) și informații referitoare la soluția integrată (Project ID, denumire Comerciant, denumire aplicație, URL website).

#### Formatul erorilor

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

#### Erori API

| Cod Eroare | Nume Eroare                    | Mesaj                                                                                                                      | Parametri          | Cod HTTP |
| ---------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- |
| `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      |
