# Errors

Plutu uses [HTTP response status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the 5xx range indicate an error with Plutu's servers (these are rare).

Some 4xx errors that could be handled programmatically (e.g., an invalid gateway) include an error code—a short string with a brief explanation—as a value for code. Below is a list of possible error codes that can be returned.

{% hint style="success" %}
**200**&#x20;
{% endhint %}

{% hint style="danger" %}
**401 -403 -404 -422 -429**
{% endhint %}

{% hint style="danger" %}
**500- 502 -503 - 504 - Server Error**
{% endhint %}

| Status                                 | Description                                                                                                                                                                          |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **200 - OK**                           | indicates that the request has succeeded, and everything works as expected.                                                                                                          |
| **400 - Bad Request**                  | indicates that the server cannot or will not process the request.                                                                                                                    |
| **401 - Unauthorized**                 | indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource. An invalid access token/API key was provided. |
| **403 - Forbidden**                    | indicates that the server understands the request but refuses to authorize it. API key doesn't have permission to perform the request.                                               |
| **404 - Not Found**                    | The requested resource doesn't exist.                                                                                                                                                |
| **422 - Un-processable Entity**        | Invalid fields will result in a 422 Unprocessable Entity response.                                                                                                                   |
| **429 - Too Many Requests**            | indicates the user has sent too many requests in a given amount of time.                                                                                                             |
| **500, 502, 503, 504 - Server Errors** | Something went wrong on Plutu's end. (These are rare).                                                                                                                               |

### R**EVIEWING ERRORS**

To monitor your integration and review errors, Plutu logs every API request your integration makes, whether it was successful or failed. You can access the logs section of the Dashboard under Gateways to review these errors.

### General Errors

General errors are a type of error that can occur when using a payment gateway integration. They are not specific to any particular endpoint or gateway and can be caused by a variety of issues such as incorrect input data, network connectivity problems, or errors with the integration itself. It's important to review these errors and understand their root cause in order to address them and ensure the smooth functioning of your payment gateway integration.

<table data-view="cards"><thead><tr><th>Error Code</th><th>Description</th></tr></thead><tbody><tr><td><strong>MAINTENANCE_MODE</strong></td><td>Plutu maintenance mode is enabled</td></tr><tr><td><strong>UNAUTHORIZED</strong></td><td>Invalid access token/API key provided, or your account has not been approved yet</td></tr><tr><td><strong>DENIED_ACCESS_GATEWAY</strong></td><td>Access denied, you do not have permission to access the payment method</td></tr><tr><td><strong>MISSING_PARAMETER</strong></td><td>Due to the missing payment gateway configuration</td></tr><tr><td><strong>INVALID_INPUTS</strong></td><td>Payment fields are incorrectly filled out</td></tr><tr><td><strong>BACKEND_ERROR</strong></td><td>Plutu Backend error</td></tr><tr><td><strong>FORBIDDEN_IP_ADDRESS</strong></td><td>The IP address is not whitelisted</td></tr><tr><td><strong>TEST_MODE_NOT_SUPPORTED</strong></td><td>Test mode is not supported for payment gateway</td></tr><tr><td><strong>TOO_MAY_REQUESTS</strong></td><td>Too many requests received</td></tr><tr><td><strong>INVALID_AMOUNT_FORMAT</strong></td><td>Transaction amount format is invalid, format is allowed with a maximum of two decimal places: XXX, XX.X, XX.XX</td></tr><tr><td><strong>AMOUNT_NOT_ALLOWED</strong></td><td>Amount must be greater than zero</td></tr><tr><td><strong>AMOUNT_EXCEEDED_MAXIMUM</strong></td><td>Amount exceeded the maximum amount allowed for a transaction: <strong>50000</strong> per transaction. <br>For sandbox: maximum <strong>500</strong> per transaction</td></tr><tr><td><strong>CURRENCY_NOT_SUPPORTED</strong></td><td>Currency is not supported</td></tr><tr><td><strong>SANDBOX_TRANSACTION_LIMIT_EXCEEDED</strong></td><td>Reaching the maximum number of transactions allowed during the period specified in the <strong>sandbox</strong> environment</td></tr></tbody></table>

### Sadad Errors

The following errors, as well as [General Errors](#general-errors), can be returned.

<table data-view="cards"><thead><tr><th>Error Code</th><th>Description</th></tr></thead><tbody><tr><td><strong>INVALID_AMOUNT</strong></td><td>Invalid amount</td></tr><tr><td><strong>INVALID_PROCESS_ID</strong></td><td>The process ID is invalid or does not match the value received in the (<strong><code>verify)</code></strong> request (lifetime 10 minutes)</td></tr><tr><td><strong>INVALID_MOBILE_NUMBER</strong></td><td>Incorrect mobile number</td></tr><tr><td><strong>INVALID_MOBILE_NUMBER_OR_BIRTH_YEAR</strong></td><td>Incorrect mobile number/year of birth</td></tr><tr><td><strong>INVLIAD_OTP</strong></td><td>Invalid OTP. please check your code and try again</td></tr><tr><td><strong>INVALID_INVOICE_AMOUNT_OR_NUMBER</strong></td><td>Invoice number already exists</td></tr><tr><td><strong>EMPTY_MOBILE_NUMBER</strong></td><td>The mobile number is empty</td></tr><tr><td><strong>EMPTY_BIRTH_YEAR</strong></td><td>Birth year is empty</td></tr><tr><td><strong>OTP_EXPIRED</strong></td><td>The OTP has exceeded the time allowed for its use</td></tr><tr><td><strong>OTP_WAIT_BEFORE_RESNED</strong></td><td>Please wait a while before requesting an OTP resend again</td></tr><tr><td><strong>INVALID_MERCHANT_CATEGORY</strong></td><td>Merchant category configuration is missing</td></tr><tr><td><strong>UNAUTHORIZED_MERCHANT_ACCOUNT</strong></td><td>Unauthorized merchant account</td></tr><tr><td><strong>NOT_ALLOWED_AMOUNT</strong></td><td>Transaction amount is not allowed</td></tr><tr><td><strong>INSUFFICIENT_BALANCE</strong></td><td>Insufficient balance for the transaction</td></tr><tr><td><strong>PHONE_NUMBER_IS_LOCKED</strong></td><td>Phone number is locked</td></tr><tr><td><strong>EXCEED_MONTHLY_AMOUNT</strong></td><td>The customer has exceeded the allowed monthly amount</td></tr><tr><td><strong>SERVICE_NOT_AVAILABLE</strong></td><td>Sadad payment service is not available, Please contact Sadad to ensure that the service is activated</td></tr><tr><td><strong>ALLOWED_ATTEMPTS_EXCEEDED</strong></td><td>You have exceeded the number of allowed transaction attempts</td></tr><tr><td><strong>INVALID_CREDENTIALS</strong></td><td>Invalid Sadad credentials</td></tr><tr><td><strong>UNKNOWN</strong></td><td>Unknown error, related to the service provider</td></tr></tbody></table>

### Adfali Errors

The following errors, as well as [General Errors](#general-errors), can be returned.

<table data-view="cards"><thead><tr><th>Error Code</th><th>Description</th></tr></thead><tbody><tr><td><strong>NOT_SUBSCRIBED</strong></td><td>The mobile number is not subscribed to Adfali service</td></tr><tr><td><strong>INVALID_AMOUNT</strong></td><td>Invalid amount</td></tr><tr><td><strong>INVALID_PROCESS_ID</strong></td><td>The process ID is invalid or does not match the value received in the (<strong><code>verify)</code></strong> request (lifetime 10 minutes)</td></tr><tr><td><strong>CONFIRMATION_ERROR</strong></td><td>Payment confirmation error, check OTP code</td></tr><tr><td><strong>INVALID_MOBILE_NUMBER</strong></td><td>Incorrect mobile number</td></tr><tr><td><strong>CHECK_BANK_ACCOUNT</strong></td><td>There is a problem with your account, please check with your bank account</td></tr><tr><td><strong>ADD_PAYMENT_ERROR</strong></td><td>payment error, unable to reach server or problem connecting to server</td></tr><tr><td><strong>BACKEND_SERVER_ERROR</strong></td><td>There is a problem connecting to the bank server, please try again later</td></tr><tr><td><strong>AUTH_ERROR</strong></td><td>Unable to reach the Adfali server right now</td></tr><tr><td><strong>INVALID_CREDENTIALS</strong></td><td>Invalid Adfali credentials</td></tr></tbody></table>

### Local Bank Cards&#x20;

There are no errors for Local Bank Cards, Only the [General Errors](#general-errors) can be returned

#### Lightbox Errors

On the checkout page (Lightbox), service providers may return error messages that are not specific to Plutu API. Here is an explanation for those error messages.

<table data-view="cards"><thead><tr><th>Error Message</th><th>Description</th></tr></thead><tbody><tr><td><strong>Order Not Found!</strong></td><td>General error but the credentials may be incorrect for use in a production environment</td></tr><tr><td><strong>Invalid Domain Request !</strong></td><td>The domain URL associated with your account by the bank is incorrect. The URL must be <strong>https://api.plutus.ly</strong></td></tr><tr><td><strong>Merchant or terminal is currently inactive</strong></td><td>Your account has not been activated or has been suspended by the bank or service provider</td></tr></tbody></table>

### T-Lync Errors

There are no errors for T-Lync, Only the [General Errors](#general-errors) can be returned

### MPGS Errors

The following errors, as well as [General Errors](#general-errors), can be returned.

<table data-card-size="large" data-view="cards"><thead><tr><th>Error Message</th><th>Description</th></tr></thead><tbody><tr><td><strong>CURRENCY_NOT_SUPPORTED</strong></td><td><p>Transaction currency is not supported by the merchant account. </p><p><em>You need to check your MPGS account that supports the selected currency</em></p></td></tr><tr><td><strong>INACTIVE_API</strong></td><td>MPGS account is not enabled for purchase. You need to contact your service provider to enable the 'PURCHASE' operation</td></tr></tbody></table>
