Error Codes
TropiPay uses conventional HTTP response 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, a charge failed, etc.), and codes in the 5xx range indicate an error with TropiPay's servers.
HTTP Status Codes
| Code | Description |
|---|---|
200 | OK - The request was successful. |
400 | Bad Request - The request was unacceptable, often due to missing a required parameter. |
401 | Unauthorized - No valid API key provided or the key has expired. |
403 | Forbidden - The API key doesn't have permissions to perform the request. |
404 | Not Found - The requested resource doesn't exist. |
422 | Unprocessable Entity - The request was well-formed but was unable to be followed due to semantic errors. |
500 | Internal Server Error - We had a problem with our server. Try again later. |
API Error Codes
When an API request fails, the response body will contain a JSON object with an error code and a descriptive message. This helps you understand the specific reason for the failure.
Common Error Response Format
{
"error": "invalid_request",
"message": "The `amount` parameter is required.",
"code": "E00123"
}
General Error Codes
| Code | Message | Description |
|---|---|---|
E00001 | invalid_credentials | The authentication credentials provided were incorrect. |
E00002 | token_expired | The access token has expired. Please request a new one. |
E00003 | permission_denied | You do not have permission to access this resource. |
E00004 | resource_not_found | The requested resource could not be found. |
E00005 | invalid_parameter | A required parameter was missing or invalid. The message will provide more details. |
Transfer & Payment Error Codes
| Code | Message | Description |
|---|---|---|
E01001 | insufficient_funds | The source account does not have enough funds to complete the transfer. |
E01002 | beneficiary_not_found | The specified beneficiary account does not exist. |
E01003 | invalid_amount | The transfer amount is below the minimum or above the maximum allowed limit. |
E01004 | 2fa_required | A two-factor authentication code is required for this transaction. |
E01005 | invalid_security_code | The provided security code is incorrect or has expired. |
E01006 | transfer_limit_exceeded | You have exceeded your daily or monthly transfer limit. |
Beneficiary Error Codes
| Code | Message | Description |
|---|---|---|
E02001 | invalid_account_number | The provided bank account number is invalid or does not exist. |
E02002 | invalid_swift_code | The provided SWIFT/BIC code is not valid. |
E02003 | beneficiary_already_exists | A beneficiary with the same account number already exists. |