PaySway uses standard HTTP response status codes to indicate the success or failure of an API request.
- Status codes in the
2xx range indicate success.
- Status codes in the
4xx range indicate a failure given the information provided.
- Status codes in the
5xx range indicate an error with the PaySway servers (shouldn’t normally happen).
Error response
In case of 4xx or 5xx response status codes, PaySway will provide an error payload containing the code and message that briefly explain the error.
A unique error code representing the specific error. See the error codes section below for possible values.
A human-readable message providing details about the error. This message is intended for developers and may contain technical information.
{
"code": "JSON_PAYLOAD_MISSING_REQUIRED_FIELD",
"message": "Missing required field at /id"
}
Error codes
Request errors
| Error code | Error description |
| BAD_REQUEST | Invalid or badly formatted request. |
| FORBIDDEN | Access denied. You don’t have permission to access this resource. |
| NOT_FOUND | The requested resource was not found. |
| UNEXPECTED_ERROR | Oops! Something went wrong in processing your request. Please contact support. |
Idempotency errors
| Error code | Error description |
| IDEMPOTENCY_KEY_HEADER_MISSING | The required Idempotency-Key header is missing. |
| IDEMPOTENCY_KEY_REQUEST_MISMATCH | Idempotency keys can only be used with the same parameters they were first used with. Try using a different key if you meant to execute a different request. |
| Error code | Error description |
| METADATA_TOO_MANY_KEYS | Too many metadata entries. Maximum allowed is 10. |
| METADATA_INVALID_KEY | Invalid metadata key. Keys must match ^[A-Za-z0-9._-]{1,40}$ (1-40 characters: letters, numbers, dots, underscores, hyphens). |
| METADATA_INVALID_VALUE | Invalid metadata value. Values must be strings with maximum length of 250 characters. |
Authentication errors
| Error code | Error description |
| AUTH_UNSUPPORTED_GRANT_TYPE | The specified grant_type is not supported. |
| AUTH_MISSING_CLIENT_CREDENTIALS | Client credentials are missing. |
| AUTH_INVALID_CLIENT_CREDENTIALS | Provided client credentials are invalid. |
| AUTH_TOO_MANY_REQUESTS | Too many authentication attempts. Please try again later. |
| AUTH_TOKEN_NOT_FOUND | Auth token header not found. Obtain an auth token first. |
| AUTH_TOKEN_INVALID | Provided token is expired, malformed, or invalid for other reasons. |
Verifications errors
| Error code | Error description |
| ACCOUNT_VERIFICATIONS_MONTHLY_QUOTA_EXCEEDED | The monthly quota for account verifications has been exceeded. |
Webhook errors
| Error code | Error description |
| WEBHOOK_SUBSCRIPTIONS_LIMIT_REACHED | The maximum number of webhook subscriptions has been reached. |
| WEBHOOK_ENDPOINT_URL_INVALID | The endpoint URL does not meet the specified requirements. |
| WEBHOOK_ENDPOINT_ALREADY_SUBSCRIBED | A webhook subscription with this endpoint URL already exists. |