error_outline

Error Handling

How PayCrypt reports errors and the HTTP status codes you should handle.

All error responses return a JSON body with an error field. Validation errors also include a details object with per-field messages.

HTTP Status Codes

StatusMeaning
200Success
201Created — payment or withdrawal created
400Bad Request — validation error or missing parameters
401Unauthorized — invalid or missing API key
404Not Found — resource does not exist
409Conflict — request conflicts with current state
429Too Many Requests — rate limit exceeded
500Internal Server Error

Response Examples

jsonValidation Error (400)
{
  "error": "VALIDATION_ERROR",
  "details": {
    "network": ["network is required"],
    "amount": ["amount must be a positive number"]
  }
}
jsonConflict (409)
{
  "error": "Request conflicts with the current resource state."
}
jsonAuthentication Error (401)
{
  "error": "Invalid or missing API key."
}