# Error Codes

## Overview
This guide provides a list of error codes returned by the Partners API, along with their descriptions.

Errors are structured in a consistent format to ensure clarity and ease of debugging.

### Example Error Response
```json
{
    "exception": {
        "errorCode": "API_IP_NOT_WHITELISTED",
        "message": "Access Denied - IP not whitelisted"
    }
}
```

## General Errors
| Error Code                 | Description                      |
|----------------------------|----------------------------------|
| INTERNAL_SERVER_ERROR      | Internal server error           |
| RATE_LIMIT_EXCEEDED        | Rate limit exceeded             |
| URL_INVALID                | Invalid URL                     |
| RESOURCE_NOT_FOUND          | Resource not found             |
| REQUIRED_FIELD_MISSING      | Required field missing         |
| BAD_REQUEST                 | Request body is invalid        |
| MOCK                       | Error in sandbox API           |
| MOCK_INVALID_VALUE                       | Invalid value for sandbox status update           |

## Access Errors
| Error Code                  | Description                    |
|-----------------------------|--------------------------------|
| API_KEY_MISSING             | API key missing               |
| API_KEY_INVALID             | API key invalid               |
| API_KEY_NO_ACCESS           | Access Denied                 |
| API_SECRET_MISSING          | API secret missing            |
| API_SECRET_INVALID          | API secret invalid            |
| API_IP_NOT_WHITELISTED      | Access Denied - IP not whitelisted |
| CREDENTIALS_NOT_FOUND       | Failed to find credentials              |

## Merchant Errors
| Error Code                               | Description                                  |
|------------------------------------------|----------------------------------------------|
| BUSINESS_KYC_NOT_VALID                   | Merchant KYC not valid                      |
| BUSINESS_NOT_ACTIVE                      | Merchant not active                         |
| BUSINESS_CANNOT_UPDATE_VALID             | Cannot update merchant with verified KYC status  |

## Transaction Errors
| Error Code                                | Description                                  |
|------------------------------------------|----------------------------------------------|
| BUSINESS_REQUEST_CANCEL_FAILED           | Failed to cancel transaction                    |
| BUSINESS_REQUEST_ACTION_UNAVAILABLE      | Action unavailable                          |
| BUSINESS_REQUEST_ACTION_FAILED           | Failed to perform action                    |
| BUSINESS_REQUEST_INVALID_TO_AMOUNT       | Invalid payout amount                           |
| BUSINESS_REQUEST_SAME_TO_FROM_BUSINESS   | Cannot perform transaction with the same deposit and payout merchant. The receiver account must belong to a different merchant.              |

## Currency Errors
| Error Code                  | Description                              |
|-----------------------------|------------------------------------------|
| CURRENCY_NOT_FOUND          | Currency not found                      |
| INVALID_CURRENCY            | Invalid currency                         |

## Receiver Account Errors
| Error Code                                                 | Description                                |
|-----------------------------------------------------------|--------------------------------------------|
| BUSINESS_EXTERNAL_ACCOUNT_CANNOT_UPDATE_NON_PENDING_ACCOUNT | Cannot update non-pending account       |

## Invoice Errors
| Error Code                                         | Description                                      |
|---------------------------------------------------|--------------------------------------------------|
| BUSINESS_INVOICE_FAILED_TO_DOWNLOAD_INVOICE      | Failed to download invoice from URL            |

