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.
code
enum
required
A unique error code representing the specific error. See the error codes section below for possible values.
message
string
required
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 codeError description
BAD_REQUESTInvalid or badly formatted request.
FORBIDDENAccess denied. You don’t have permission to access this resource.
NOT_FOUNDThe requested resource was not found.
UNEXPECTED_ERROROops! Something went wrong in processing your request. Please contact support.

Idempotency errors

Error codeError description
IDEMPOTENCY_KEY_HEADER_MISSINGThe required Idempotency-Key header is missing.
IDEMPOTENCY_KEY_REQUEST_MISMATCHIdempotency 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.

Authentication errors

Error codeError description
AUTH_UNSUPPORTED_GRANT_TYPEThe specified grant_type is not supported.
AUTH_MISSING_CLIENT_CREDENTIALSClient credentials are missing.
AUTH_INVALID_CLIENT_CREDENTIALSProvided client credentials are invalid.
AUTH_TOO_MANY_REQUESTSToo many authentication attempts. Please try again later.
AUTH_TOKEN_NOT_FOUNDAuth token header not found. Obtain an auth token first.
AUTH_TOKEN_INVALIDProvided token is expired, malformed, or invalid for other reasons.

Verifications errors

Error codeError description
ACCOUNT_VERIFICATIONS_MONTHLY_QUOTA_EXCEEDEDThe monthly quota for account verifications has been exceeded.

Webhook errors

Error codeError description
WEBHOOK_SUBSCRIPTIONS_LIMIT_REACHEDThe maximum number of webhook subscriptions has been reached.
WEBHOOK_ENDPOINT_URL_INVALIDThe endpoint URL does not meet the specified requirements.
WEBHOOK_ENDPOINT_ALREADY_SUBSCRIBEDA webhook subscription with this endpoint URL already exists.