Errors
Errors are JSON, and the status code tells you what to do next.
Business errors carry an error code and a message. Authentication and validation errors follow Laravel's shape: {"message": "..."}, and {"message": "...", "errors": {...}} for validation.
| Status | When |
|---|---|
400 / 422 | Invalid input: bad or missing fields, or an unknown plan |
401 | Missing or invalid API key |
402 | Insufficient API balance |
403 | The key lacks the required scope, or the client is not permitted |
404 | The API is disabled, or the resource was not found |
409 | duplicate_in_progress: an order with this reference is still being processed. Retry the same reference shortly |
429 | Rate limit exceeded |
500 | The order could not be finalised. Your balance is refunded automatically |
502 | No provider could fulfil it right now. Your balance is refunded automatically |
{
"error": "insufficient_balance",
"message": "Top up your API balance and retry."
}
{
"message": "The plan id field is required.",
"errors": {
"plan_id": [
"The plan id field is required."
]
}
}