Integration
Response Format
All API responses follow a consistent JSON structure for easy parsing and error handling.
Success Response
When a request succeeds, you'll receive a response with success: true:
Success Response Structure
{
"success": true,
"data": {
// Response data varies by endpoint
},
"message": "Optional success message",
"meta": {
"mode": "test",
"request_id": "req_abc123def456"
}
}
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true for successful requests |
data |
object | The response payload (varies by endpoint) |
message |
string | Optional human-readable success message |
meta |
object | Metadata including mode and request ID |
Error Response
When a request fails, you'll receive a response with success: false:
Error Response Structure
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The phone_number field is required.",
"details": {
"phone_number": ["The phone_number field is required."]
}
},
"meta": {
"mode": "test",
"request_id": "req_xyz789"
}
}
Common Error Codes
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR |
Request body validation failed |
| 401 | UNAUTHORIZED |
Missing or invalid API credentials |
| 403 | FORBIDDEN |
API key lacks required scope |
| 404 | NOT_FOUND |
Requested resource not found |
| 409 | CONFLICT |
Resource already exists or state conflict |
| 429 | RATE_LIMITED |
Too many requests, slow down |
| 500 | INTERNAL_ERROR |
Server error, contact support |
Handling Errors
1
Check the success Field
Always check success before processing the response data.
JavaScript Example
const response = await fetch('/api/v1/developer/...');
const data = await response.json();
if (!data.success) {
console.error('Error:', data.error.message);
return;
}
// Process data.data
2
Handle Specific Error Codes
Different error codes may require different handling strategies.
3
Log the Request ID
Include meta.request_id when contacting support - it helps us debug issues quickly.
Pagination
List endpoints return paginated results:
Paginated Response
{
"success": true,
"data": {
"items": [...],
"pagination": {
"current_page": 1,
"per_page": 20,
"total": 150,
"total_pages": 8
}
}
}
Use query parameters to navigate pages:
?page=2- Request a specific page?per_page=50- Change items per page (max 100)