HTTP Status Codes
HTTP Status Codes
This section provides an overview of the HTTP status codes returned by the API.
These codes indicate whether a request was successfully processed or if an error occurred.
Understanding these responses is essential for implementing proper error handling and ensuring reliable communication with the PaysafeCard API.
Status Codes
| Code | Short Description | Description |
|---|---|---|
| 200 | OK | The request was successfully processed. |
| 201 | Created | The resource was successfully created. |
| 400 | Bad Request | The request contains invalid or malformed data. |
| 401 | Unauthorized | The request could not be authenticated (e.g. invalid or expired API key). |
| 404 | Not Found | The requested resource or feature is not available (e.g. cashout feature disabled). |
| 500 | Internal Server Error | An unexpected error occurred on the PaysafeCard side. |
| 501 | Not Implemented | The requested functionality or API version is not supported. |
| 502 | Bad Gateway | An invalid response was received from an upstream system. |
| 503 | Service Unavailable | The service is temporarily unavailable (e.g. due to high load). |
| 504 | Gateway Timeout | The upstream system did not respond within the expected timeframe. |
Example: Error Response
The following example illustrates a typical error response for an invalid request:
400 Bad Request
{
"code": "invalid_request_parameter",
"message": "Correlation-ID is invalid: 'test123!'",
"number": 10028,
"param": "Correlation-ID"
}