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.
NOT_FOUNDThe requested resource was not found.
UNEXPECTED_ERROROops! Something went wrong in processing your request. Please contact support.

JSON errors

Error codeError description
JSON_PAYLOAD_MALFORMEDThe JSON payload is not valid or well-formed.
JSON_PAYLOAD_MISSING_REQUIRED_FIELDA required field is missing from the JSON payload.
JSON_PAYLOAD_INVALID_ENUM_VALUEAn invalid value was provided for an enum field in the JSON payload.

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.

Webhook errors

Error codeError description
WEBHOOK_SUBSCRIPTIONS_LIMIT_REACHEDThe maximum number of webhook subscriptions has been reached.
WEBHOOK_ENDPOINT_URL_INVALIDThe provided webhook endpoint URL is invalid or unreachable.