Errors
Learn about errors returned in the API responses from Razorpay.
All successful responses are returned with HTTP Status code 200. In case of failure, Razorpay API returns a JSON error response with the parameters that detail the reason for the failure.
Handy Tips
If you are using an official Razorpay Language-wise SDK Integration, the error responses result in exceptions that need to be handled in your integration.
Error Response🔗
The error response contains code, description, field, source, step, reason and metadata parameters that help you diagnose and solve the error.
To understand more about error codes, refer to the Error Codes section.
Copy{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Authentication failed due to incorrect otp",
"field": null,
"source": "customer",
"step": "payment_authentication",
"reason": "invalid_otp",
"metadata": {
"payment_id": "pay_EDNBKIP31Y4jl8",
"order_id": "order_DBJKIP31Y4jl8"
}
}
}
Response Parameters🔗
error-
objectThe error object. code-
stringType of the error. description-
stringDescriptive text about the error. field-
stringName of the parameter in the API request that caused the error. source-
stringThe point of failure in the specific operation (payment in this case). For example, customer, business step-
stringThe stage where the transaction failure occurred. The stages can vary depending on the payment method used to complete the transaction. reason-
stringThe exact error reason. It can be handled programmatically. metadata-
objectContains additional information about the request.payment_idstringUnique identifier of the payment.order_idstringUnique identifier of the order associated with the payment.
ON THIS PAGE