# HTTP Response and Error Codes

## API Errors

Most common API errors are as follows, including message, reason and status code.

Response example:

```
{
  "error": "API request limit is exceeded",
  "error_code": "API_LIMIT_EXCEEDED",
  "status": "400"
}
```

| status | error\_code                           | error                                                                                 |
| ------ | ------------------------------------- | ------------------------------------------------------------------------------------- |
| 400    | AUTHENTICATION\_FAILED                | Authentication Token is not set or expired.                                           |
| 400    | INVOICE\_NOT\_EXIST                   | Invoice does not exist.                                                               |
| 400    | INVOICE\_VERIFIED\_ALREADY            | It has been verified already.                                                         |
| 400    | INVOICE\_CANCELED\_FAIILED            | Invoice does not exist, or it cannot be canceled.                                     |
| 400    | ORDER\_NO\_PERMISSION                 | Order does not exist or permission denied.                                            |
| 400    | ORDER\_CANCELED\_FAIILED              | Order does not exist, or it cannot be canceled.                                       |
| 400    | ORDER\_REFUND\_FAILED                 | Order does not exist, or it\`s status is not refundable.                              |
| 400    | ORDER\_VERIFIED\_ALREADY              | Payment has been verified with payment already.                                       |
| 400    | ORDER\_VERIFIED\_PRICE\_NOT\_MATCH    | Payment money does not match the order money, please double check the price.          |
| 400    | ORDER\_VERIFIED\_MERCHANT\_NOT\_MATCH | Payment money does not the order of current merchant , please double check the order. |
| 400    | ORDER\_NOT\_VALID                     | Order id is not valid.                                                                |
| 400    | ORDER\_PAID\_FAILED                   | Order not exist or is not paid yet.                                                   |
| 400    | ORDER\_MERCHANTID\_EXIST              | Order with same merchant\_order\_id exisits.                                          |
| 400    | ORDER\_NOT\_NEW                       | The current order is not new, and payment method cannot be switched.                  |
| 400    | PAYMENT\_NOT\_AVAILABLE               | The payment method is not working, please retry later.                                |
| 400    | MERCHANT\_CALLBACK\_STATUS\_WRONG     | The current payment status not ready to send callback.                                |
| 400    | PARAMETERS\_MISSING                   | Missing parameters.                                                                   |
| 400    | PAY\_PRICE\_ERROR                     | Price amount or currency is not set correctly.                                        |
| 400    | CREDENTIALS\_NOT\_MATCH               | The email or password does not match.                                                 |
| 400    | USER\_NOT\_EXIST                      | The user does not exist or no permission.                                             |
| 400    | USER\_FAILED                          | The user operatioin failed.                                                           |
| 400    | INVITATION\_FAILED                    | The invitation code is not filled correctly.                                          |
| 400    | ERROR                                 | Error.                                                                                |
| 401    | (Unauthorized)                        | API credentials are not valid                                                         |
| 404    | (Not Found)                           | Page, action not found                                                                |
| 421    | (Too Many Requests)                   | API request limit is exceeded                                                         |
| 500    | (InternalServerError)                 | Server error in MugglePay                                                             |
