Skip to main content
Available in🇮🇳 India
This page brings together the error-handling rules for Razorpay APIs: how to read a failure response, what to do for each class of error, what to show the customer, what to log and how to recover a request that timed out. It is for developers who call Razorpay APIs from their server or handle payment failures from Checkout. To look up a specific error reason, use the product error lists.

Read the error response

When a request fails, Razorpay returns a JSON error response with the relevant error parameters. The error response contains code, description, field, source, step, reason and metadata. The source parameter tells you where the error originated and who needs to act. The values and the action for each are listed in the List of Errors. The values of source and step for each payment method are in Payment Method Error Parameters. See the sample error response and the full parameter descriptions in About Errors.

What to do for each error class

For payments APIs, read error.code, reason, source and step before you decide what to do next. For RazorpayX payouts, see RazorpayX payouts. Follow these rules when you build the handling:
  • Do not retry a bad request as-is. The same BAD_REQUEST_ERROR fails again and again.
  • For a BAD_REQUEST_ERROR with the reason input_validation_failed, check the description and field parameters to find what to correct in the request.
  • Branch your logic on reason and source, not on description. If you match on description, a wording change breaks your handling.
For the HTTP status code returned with each kind of failure, see HTTPS Status Codes. For requests that are rate limited, see Rate Limiting.

What to show the customer

Show the customer the description, and give them a meaningful next step based on the payment step and the failure reason. For example, when the reason is invalid_otp, you can notify the customer and ask them to retry the payment with the correct OTP. On Standard Checkout, the behaviour depends on how you integrated: See Handle Payment Success and Failure in the Standard Checkout integration steps for the failure handling code.
Watch Out!A failed payment signature check is not an error to recover from. It indicates a potentially fraudulent or tampered payment. Reject the order entirely: do not fulfil it, do not retry and do not treat it as a genuine payment.

What to log

Log reason, source and step for support and dashboards. Group failures by reason to spot a bank or method that is failing. Without per-reason monitoring, a failing bank can go unnoticed for hours.

Recover a request that timed out

Every call you might retry must be safe to repeat. To fetch the payments made against an order, use the Fetch Payments for an Order API. Fetching the order’s payments before you retry a payment assumes that you retry on the same order. Check that this matches your integration if you create a new order for each attempt. See Retries and Idempotency for the scenarios to test.

RazorpayX payouts

When you retry a payout request after a 5XX error:
  1. Use the same idempotency key as the original request.
  2. Send the same request body. A different request body for the same idempotency key is rejected.
Razorpay guarantees the payout will not be processed twice if it was already completed. If the payout was created by the first request, the retried request returns the created payout details along with its current status. See Handling 5XX Errors for the recommended retry schedule and how to check the payout status, and Make a Request Idempotent to add the idempotency key.

Product error lists

Use these pages to look up an error reason and its next steps.
Last modified on December 4, 2026