Error Codes

Complete reference of API error codes and their meanings

Error Response Format#

All error responses follow the same structure:

Error Response
{
  "code": 400,
  "status": "failed",
  "message": "customer with id: +213555123456 is not found",
  "errors": []
}
FieldTypeDescription
codenumberHTTP status code
statusstringAlways "failed" for errors
messagestringHuman-readable error description
errorsstring[]Additional details (e.g., validation constraint messages)

HTTP Status Codes#

StatusMeaningAction
200SuccessRequest completed successfully
201CreatedResource created successfully
400Bad RequestCheck request parameters and error message
401UnauthorizedCheck API credentials
404Not FoundResource does not exist
409ConflictResource already exists or concurrent processing conflict
500Server ErrorRetry the request

Authentication Errors#

HTTPMessageCause
400Client credentials are missingNo Authorization header provided
400Client credentials id is missingMalformed Basic auth header (missing client ID)
400Client credentials are invalidWrong client ID or secret
400Invalid access tokenThe customer access token is invalid
400Access token has expiredThe customer access token has expired, refresh it

Customer Errors#

HTTPMessageCause
400Customer already existsA customer with this phone number is already registered
400Customer not found with id {id}No customer exists with the given ID
400customer with phone: {phone} is not foundNo customer registered with this phone number

Payment Intent Errors#

Create Intent#

HTTPMessageCause
400customer with id: {userId} is not foundThe userId does not match any registered customer
400service with code: {code} not foundThe x-service header value is not a valid service
400service with code: {code} is not activeThe service exists but is disabled
400country with code: {code} not foundThe countryCode or actionCountryCode is invalid
400currency with code: {code} not foundThe actionCurrencyCode is not supported
409Payment action {actionId} already exists with amount {amount}. Cannot change amount to {newAmount}. Amount is immutable after creation.Reusing an actionId with a different amount

Proceed Payment#

HTTPMessageCause
400payment not found with id {paymentId}The payment ID does not exist
400payment is already doneThe payment has already succeeded
400payment was rejectedThe payment previously failed
400payment is ProcessingThe payment is already being processed
400client token user phone does not match transaction customer phoneThe x-client-token belongs to a different user
400pm {code} is not active in this country and currencyThe payment method is not available for this country/currency
409payment is already being processed by another requestConcurrent proceed calls for the same payment

Capture & Release#

HTTPMessageCause
400Payment not found with id {paymentId}The payment ID does not exist
400Payment has already been capturedThe payment was already captured
400Payment has already been releasedThe pre-authorization was already released
400Payment is not in pre-authorized stateThe payment must be in PRE_AUTHORIZED state (statusCode 13) before capture or release
400Capture amount {amount} exceeds remaining capturable amount {remaining}Trying to capture more than was pre-authorized
409Payment is already being processed by another requestConcurrent capture/release calls

Refund#

HTTPMessageCause
404Transaction not found.The payment ID does not exist
400Transaction has not been captured yet and cannot be refundedThe payment must be in SUCCEEDED state first
400Transaction already fully refunded.No remaining balance to refund
400Transaction cannot be refunded, not accepted.The payment is not in a refundable state
400Refund amount exceeds refundable amount. Maximum refundable amount is {amount}.The refund amount is larger than the remaining balance
400Transaction cannot be refunded after cashback has been applied.Cashback was already applied to this transaction
409Refund failed — transaction was modified concurrently or refund amount exceeds remaining balance. Please retry.Concurrent refund calls, retry the request

Payment Method Errors#

HTTPMessageCause
404No Payment Method FoundNo payment methods are available for the given country/currency
404Service not foundThe service from x-service header does not exist
404Country not foundThe countryCode is not valid
404PaymentMethod not foundThe payment method ID does not exist

Validation Errors#

When request body validation fails (e.g., missing required fields, invalid types), the API returns a 400 with the constraint violation messages in the errors array:

Validation Error Example
{
  "code": 400,
  "status": "failed",
  "message": "Bad Request",
  "errors": [
    "amount must not be less than 1",
    "actionCurrencyCode must be a string",
    "userId should not be empty"
  ]
}

The errors array contains one entry per failed validation constraint, generated from the request DTO field decorators. Fix all listed errors before retrying.