Error Codes

Reference for Apple Pay Custom Checkout error responses, canMakePayment reasons, payment error responses, client errors and a handling guide.


This page lists the error responses you can encounter while integrating Apple Pay on Custom Checkout, what triggers each one and how to handle them.

When canMakePayment() returns { available: false }, the reason field indicates why:

{
"status": "failure",
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Payment failed due to insufficient funds",
"step": "payment_authentication",
"reason": "insufficient_funds",
"source": "customer",
"metadata": { "payment_id": "pay_xxx", "order_id": "order_xxx" }
}
}

Returned from createPayment() or the onFailure callback:

For backend payment failures (for example, card declined, insufficient funds, invalid order), all error fields (code, reason, description, source, step, metadata) are propagated directly from the Razorpay backend. Refer to the

documentation for the full list of possible values.

Thrown as exceptions during initialization and setup — before any payment flow. Merchants should wrap these calls in try/catch:


Is this integration guide useful?


apple pay
custom checkout
error codes
error responses
headless sdk