Exceptions occur when an API operation fails to process a request payload. In such scenarios, error codes and its corresponding HTTP status codes help troubleshoot the possible failure reason. For example, in a scenario where a user provides invalid inputs such as card number, CVV or expiry date.
The sample error response given below shows the HTTP response body structure that is returned in case of errors:
ER007: Sample Error Response
HTTP Response Body:
{
"errorCode": "ER007",
"errorType": "INVALID_ARGUMENT_ERROR",
"errorMessage": "Invalid argument error occurred. Check additionalInfo for more details.",
"traceId": "adb0213f-63aa-48f4-9dda-d033fa1c6641",
"additionalInfo": {
"amount": "may not be null",
"requestId": "may not be null"
}
}
HTTP Status Code: 400
The corresponding HTTP status codes are mapped as 4xx or 5xx based on the 'Error Type'.
traceId is a unique identifier of the error being reported. traceId needs to be shared with Zeta while referring to any error response where support is needed.
The following table lists the possible error codes and its descriptions that are generated by the payment API services:
Error Type
Error Code
Error Description
HTTP Status Code
INTERNAL_SERVER_ERROR
ER000
Unexpected server error occurred.
500
INVALID_CARD_NUMBER
ER001
Invalid card number. It can only be numeric.
400
INVALID_CARD_NUMBER_LENGTH
ER002
Card number can only be of length 16.
400
INVALID_CVV
ER003
Invalid card CVV. It can only be numeric
400
INVALID_CVV_LENGTH
ER004
Card CVV can only be of length 3.
400
INVALID_CARD_EXPIRY_MONTH
ER005
Card expiry month is invalid.
400
INVALID_CARD_EXPIRY_YEAR
ER006
Card expiry year is invalid.
400
INVALID_ARGUMENT_ERROR
ER007
Invalid argument error occurred. Check additionalInfo for more details.
400
INVALID_TRANSITION
ER008
Transition not supported from current state.
422
TRANSACTION_NOT_FOUND
ER010
Transaction not found.
404
TRANSACTION_ALREADY_PRESENT
ER011
Transaction with given requestId already present
400
MISSING_REQUEST_PARAMETER
ER012
Missing request parameter
400
PRECONDITION_MISMATCH
ER013
IllegalStateException
400
INVALID_SOURCE
ER014
Invalid source id given
400
SAVE_FOR_FUTURE_DISABLED
ER015
SaveForFuture is not enabled for this source
401
INVALID_MERCHANT_INFO
ER016
Given merchant info is invalid
400
INVALID_API_KEY
ER017
Given API Key is not valid
400
MISSING_API_KEY_HEADER
ER019
apiKey header is missing
400
INVALID_PUBLISHABLE_KEY
ER020
Unauthorised request made
401
REFUND_AMOUNT_MISMATCH
ER021
Transaction amount and refund request amount should be same