The P100 API uses a consistent JSON structure for error responses. Understanding the two primary types of errors is key to building a robust integration.
1. Standard API Errors (Business Logic)#
These errors relate to business logic, resource states, or permissions, and always feature a three-field structure.{
"errorCode": "P424",
"errorName": "source-or-destination-required",
"errorMessage": "Source or destination must be provided."
}
errorCode: A unique code (e.g., P424, P433) for driving application logic.
errorName: A human-readable identifier for the error.
errorMessage: A detailed description for debugging and logging purposes.
2. Validation Errors (P403)#
These errors are automatically generated when request data fails format validation (e.g., invalid email format, missing required field). They have a streamlined structure.{
"errorCode": "P403",
"errorMessage": "currency must be one of the following values: btc, eth, usdt. Amount can have at most 8 decimal places."
}
Fixed Error Code: Always returns errorCode: "P403".
Concatenated Messages: errorMessage may contain multiple validation failures in a single string.
Always a 400 Status: The response will always have HTTP 400 Bad Request.
P403 Note: This is an aggregate error code. The errorMessage field may contain multiple, concatenated messages about various failed conditions (e.g., invalid data format, missing required field). For a comprehensive list of possible validation rules, please refer to the specific endpoint documentation or contact support.
Best Practices for Error Handling#
Regardless of the error type, follow this unified approach:1.
Check the HTTP Status Code First: Use the status code (4xx or 5xx) as the initial indicator of an error.
2.
If errorCode is P403, handle it as a general validation failure (e.g., display an "invalid input" message to the user).
For other codes (e.g., P424, P433), implement specific logic if necessary (e.g., "Insufficient funds"). However, rely primarily on errorName for readable identifiers.
3.
Log errorMessage for Debugging: Always log the full errorMessage to aid in diagnosing issues, but do not display it directly to the end-user, as it may contain sensitive technical details.
Common Error Codes Reference (Selected)#
Instead of listing all possible errors, focus on the most common or critical ones, and group them logically. Developers can always consult support or logs for less frequent errors.HTTP: 400 - Bad Request Errors (Common)#
| Error Code | Error Name | Error Message Example |
|---|
| P403 | Validation Error | currency must be one of the following values... |
| P410 | invalid-currency | Currency not found |
| P411 | user-exists | User exists |
| P412 | invalid-user | User does not exist |
| P424 | source-or-destination-required | Source or destination must be provided. |
| P433 | insufficient-funds | Insufficient funds |
| P451 | forbidden-country-card | User of this country cannot have card |
| P455 | user-suspended | User suspended |
HTTP: 401 - Unauthorized Errors#
| Response | Description |
|---|
| Access Denied. xo1 | API key not provided |
| Access Denied. xo2 | Invalid API key provided |
| Access Denied. xo3 | IP address not whitelisted (production) |
HTTP: 404 - Not Found Errors (Common)#
| Error Code | Error Name | Error Message Example |
|---|
| P421 | withdrawal-not-found | Withdrawal not found |
| P423 | transfer-not-found | Transfer not found |
| P425 | exchange-not-found | Exchange not found |
| P463 | order-not-found | Order not found |
| P464 | payment-link-not-found | Payment link not found |
HTTP: 202 - Accepted (Pending Responses)#
| Error Code | Error Name | Error Message Example |
|---|
| P210 | poa-file-not-found | POA file not yet uploaded. |
| P211 | poa-verification-pending | POA verification pending |
| P212 | kyc-verification-pending | KYC verification pending |
Need Help?#
📖 FAQ
Find answers to the most common questions about our API.💬 Support
Can't find what you're looking for? Contact our support team for assistance.