Errors

Card Acceptance Errors

The Card Acceptance API uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • codes in the 2xx range indicate success
  • codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a header is missing, etc.
  • codes in the 5xx range indicate an error with Ayoconnect system
  • codes with exactly 503 indicate an error with Supplier system

As our API can raise errors for many reasons, such as a failed charge, invalid parameters, authentication errors.. we recommend writing code that gracefully handles all possible error codes.

All the errors include an error code and a short human-readable message that briefly explains the error reported (you can use it internally but don't share it with your clients/users).

Error responses

Error responses are a combination of the HTTP response code, the service code, and the case dode.

Error response = HTTP response code + service code + case code

Service Codes

Below is a list with all the service codes:

Service codeService
01Card Registration
03Get Card
04Unbinding
54Payment Charge
55Get Payment Status
57Payment Void
58Payment Refund

HTTP Response Codes

Below is a list of possible HTTP response codes, along with additional information about them:

HTTP ResponseMessageDescription
400Bad RequestThe server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
401UnauthorizedAlthough the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
403ForbiddenThe client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.
404Not FoundThe server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client.
409ConflictThis response is sent when a request conflicts with the current state of the server.
429Too Many RequestsThe user has sent too many requests in a given amount of time.
500Internal Server ErrorThe server has encountered a situation it does not know how to handle.
503Service UnavailableExternal third party or supplier failure
504Gateway TimeoutThis error response is given when the server is acting as a gateway and cannot get a response in time.

Case Codes

Below is a list of all Internal possible HTTP response codes and case codes, along with additional information about them:

HTTP CodeService CodeCase CodeResponse MessageResponse Description
400XX00Bad RequestGeneral Request Failed Error
400XX01Invalid Field Format '{fieldName}''{fieldName}' is invalid
400XX02Invalid Mandatory FieldA required field is missing or invalid
400XX03Duplicate Field ValueThe field value is duplicated
401XX00UnauthorizedUnauthorized Error
401XX01Invalid token (B2B)B2B Token is invalid
401XX02Invalid Customer TokenThe Customer Token is invalid
401XX03Token Not found (B2B)The B2B Token Not Found
401XX04Customer Token Not FoundThe customer token not found
403XX00Transaction ExpiredThe transaction has expired
403XX01Featured not allowedThe requested feature not allowed
403XX02Exceeds Transaction Amount LimitThe transaction amount exceeds the allowed limit
403XX03Suspected FraudThe transaction is suspected to be fraudulent
403XX04Activity Count Limit ExceededThe number of requests exceeded the limit
403XX05Do Not HonorThe transaction was not honored by supplier
403XX06Do Not HonorThe transaction was not honored by supplier
403XX07Do Not HonorThe transaction was not honored by supplier
403XX08Do Not HonorThe transaction was not honored by supplier
403XX09Dormant AccountThe account is dormant and cannot process transaction
403XX12OTP lifetime expiredThe OTP has expired
403XX14Insufficient FundsThere are insufficient funds in the account
403XX15Transaction Not PermittedThe transaction is not permitted
403XX16Suspend TransactionsThe transaction has been suspended
403XX18Inactive Card/Account/CustomerThe account or customer is inactive
403XX19Merchant BlacklistedThe merchant is blacklisted
403XX20Merchant Limit ExceededThe merchant has exceeded their transaction limit
403XX23Account Limit ExceededThe account has exceeded its limit
403XX24Customer Not FoundThe customer could not be found
403XX25Merchant Not FoundThe merchant could not be found
403XX26No Data FoundNo data was found matching the request
404XX00Invalid Transaction StatusThe transaction status is invalid
404XX01Transaction Not FoundThe specified transaction could not be found
404XX04Transaction CancelledThe transaction was cancelled by customer
404XX08Invalid MerchantThe merchant id is invalid
404XX13Invalid AmountThe specified amount is invalid
404XX15Invalid OTPThe OTP provided is Invalid
404XX16Registration/Account Token Not FoundThe registration or account token could not be found
409XX00Too Many RequestsThe maximum transaction limit has been exceeded
409XX01Duplicate partnerReferenceNoA duplicate partner reference number was found
409XX02Customer exist for this phone numberA customer already exists with the specified phone number
409XX03Duplicate EntryThe entry is a duplicate
500XX00General ErrorUnknown internal server failure
500XX01Internal Server ErrorAn internal server error occurred
504XX00TimeoutThe request timed out

In Card Acceptance, all error that starts with 503 will be considered as external error from suppliers.

Below is a list of all External possible HTTP response codes and case codes:

HTTP CodeService CodeCase CodeResponse Description
503XX00ABORTED
503XX01ACQUIRER_SYSTEM_ERROR
503XX02AUTHENTICATION_FAILED
503XX03AUTHENTICATION_IN_PROGRESS
503XX04BLOCKED
503XX05CANCELLED
503XX06DECLINED
503XX07DECLINED_AVS
503XX08DECLINED_AVS_CSC
503XX09DECLINED_CSC
503XX10DECLINED_DO_NOT_CONTACT
503XX11DECLINED_INVALID_PIN
503XX12DECLINED_PAYMENT_PLAN
503XX13DECLINED_PIN_REQUIRED
503XX14DEFERRED_TRANSACTION_RECEIVED
503XX15DUPLICATE_BATCH
503XX16EXCEEDED_RETRY_LIMIT
503XX17EXPIRED_CARD
503XX18INSUFFICIENT_FUNDS
503XX19INVALID_CSC
503XX20LOCK_FAILURE
503XX21NOT_ENROLLED_3D_SECURE
503XX22NOT_SUPPORTED
503XX23NO_BALANCE
503XX24PARTIALLY_APPROVED
503XX25PENDING
503XX26REFERRED
503XX27SUBMITTED
503XX28SYSTEM_ERROR
503XX29TIMED_OUT
503XX30UNKNOWN
503XX31UNSPECIFIED_FAILURE
503XX32EXTERNAL_VERIFICATION_BLOCKED
503XX33EXTERNAL_VERIFICATION_DECLINED
503XX34EXTERNAL_VERIFICATION_DECLINED_AUTHENTICATION_REQUIRED
503XX35EXTERNAL_VERIFICATION_DECLINED_EXPIRED_CARD
503XX36EXTERNAL_VERIFICATION_DECLINED_INVALID_CSC
503XX37EXTERNAL_VERIFICATION_PROCESSING_ERROR
503XX38NO_VERIFICATION_PERFORMED
503XX39SCHEME_TOKENIZATION_DECLINED
503XX40SCHEME_TOKENIZATION_ERROR
503XX41SCHEME_TOKENIZATION_SUCCESSFUL_ADDITIONAL_AUTHENTICATION_REQUIRED