Errors

Direct Debit API Errors

The Direct Debit 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 or the bank's system (these are rare but they happen).

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
00Callback API
10Generate B2B Access Token API
20Generate B2B2C Customer Authorization Token API
30Get Oauth Code API
31Account Binding API
32Account Unbinding API
33Direct Debit Payment API
34Verify OTP API
35Get a List of Cards Bound to a Customer API
36Get the Status of a transaction API

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.
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 possible HTTP response codes and case codes, along with additional information about them:

HTTP CodeService CodeCase CodeResponse MessageResponse Description
400XX00Bad Request
400XX01Invalid Field Format '{fieldName}''{fieldName}' is invalid
400XX01Invalid Field Format otpAllowedThe 'otpAllowed' parameter should be either YES or NO
400XX02Invalid Field X-TimestampInvalid mandatory header X-Timestamp
400XX02Invalid Field Format Redirect UrlInvalid mandatory parameter redirect url
400XX02Invalid Field Format StateInvalid mandatory parameter state
400XX02Invalid Field Format Seamless DataInvalid mandatory parameter seamless data
400XX02Invalid Field X-CLIENT-KEYInvalid mandatory header X-CLIENT-KEY
400XX02Invalid Field FormatInvalid Format
400XX02Invalid Field Format Content-TypeInvalid mandatory header Content-Type
400XX02Invalid Mandatory FieldThe mandatory field is invalid
400XX02Invalid Field ScopesInvalid field format Scopes
400XX02Invalid Field Format CurrencyInvalid mandatory parameter currency
400XX02Invalid Field Format X-EXTERNAL-IDInvalid mandatory header X-EXTERNAL-ID
400XX02Invalid Field Format grant_typeInvalid mandatory parameter grant_type
400XX02Invalid Field Format Seamless DataInvalid mandatory parameter seamless data
400XX02Invalid Field Format CHANNEL-IDInvalid mandatory header CHANNEL-ID
400XX02Invalid Field X-TimestampInvalid field format of X-Timestamp
400XX02Invalid Field X-PARTNER-IDInvalid field format of X-PARTNER-ID
400XX02Invalid Field Format partnerReferenceNoInvalid mandatory parameter partnerReferenceNo
400XX02Invalid AuthCodeInvalid AuthCode
400XX02Invalid Field Format AcceptInvalid mandatory header Accept
401XX00UnauthorizedInvalid Authorization-Customer Header
401XX00UnauthorizedInvalid mandatory header X-SIGNATURE
401XX00UnauthorizedInvalid Authorization Header
403XX00Session ExpiredSession expired. Please try again
403XX03Suspected Fraud TransactionSuspected Fraud
403XX04Activity Count Limit ExceededRetry count exhausted. Please try after some time
403XX04Insufficient FundAccount does not have sufficient balance
403XX05Do Not HonorThe customer is blocked. Please reach out to Ayoconnect for resolution
403XX05Do Not HonorCard account has been frozen
403XX05Do Not HonorMaximum (OTP) passcode retries have been attempted. The customer is blocked
403XX05Card BlockedThe Card is blocked. Please reach out to Ayoconnect for resolution
403XX07Card DisabledThe Card is disabled
403XX07Card BlockedCard is blocked or temporarily disabled by the bank
403XX07Card BlockedThe Card is blocked. Please reach out to Ayoconnect for resolution
403XX08Card ExpiredCard has expired
403XX12OTP Lifetime ExpiredThe (OTP) passcode has expired
403XX16Suspend TransactionsAn error occurred while performing the transaction using the card
403XX18Timeout from BankServer Timeout from Bank. Please try again in sometime.
403XX18Inactive CardCard is inactive
403XX18Inactive CustomerThe customer is inactive. Please reach out to Ayoconnect for resolution
403XX20Transaction Limit ExceededExceeds Transaction Amount Limit
403XX20Transaction FailedPayment without OTP is not allowed for this amount
403XX20Transaction FailedAmount is lesser than the merchant limit
403XX20Transaction FailedPayment with OTP requires minimum amount
403XX20Transaction FailedPayment without OTP is not allowed for this amount
403XX20Dormant AccountThe account is dormant
404XX00Invalid Transaction StatusThe transaction status is invalid
404XX01Transaction Not FoundTransaction Not Found
404XX02Invalid TokenThe bank card token or account token is invalid/expired
404XX02Invalid ActionInvalid mandatory parameter action
404XX02Invalid XExternalIdInvalid mandatory parameter XExternalId
404XX07Invalid PublicUserIdThe publicUserId is invalid
404XX08Inactive MerchantMerchant is inactive
404XX08Invalid MerchantMerchant not found
404XX08Invalid MerchantThe merchantId is invalid
404XX11Invalid CardCard number is invalid
404XX11Invalid CardCard was not found
404XX11Invalid CustomerCustomer not found
404XX11Invalid CustomerMerchant and Customer details are mismatched
404XX13Invalid AmountThe amount is invalid
404XX13Invalid Field Format bankCodeInvalid mandatory parameter bankCode
404XX15Invalid OTPThe (OTP) passcode is incorrect
404XX15Invalid OTPThe otpToken is invalid
404XX15Invalid OTPThe (OTP) passcode is invalid
405XX00Requested Function Is Not SupportedPayment with OTP is not supported for this bank
409XX00ConflictCannot use same 'X-EXTERNAL-ID' in different flow
429XX00Too Many RequestsThe OTP requests have reached the maximum
500XX00General ErrorOTP configuration not found for merchant
500XX00General ErrorCard deletion process has failed
500XX02Internal Server ErrorInternal Server Error
500XX03Transaction FailedA bank error occurred while performing this operation
504XX00TimeoutServer Timeout
504XX00TimeoutBank gateway timeout