> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cards: How to Test Your Integration

> Test one-time card payments on S2S JSON and S2S Redirect in Test Mode, including authentication, saved cards, tokens and failure scenarios.

Available in
🇮🇳 India

Run successful payments, simulate failures with test cards and reconcile against the webhooks in test mode, then check saved cards, tokens and the on-demand APIs before you go live.

This page covers one-time card payments on **S2S JSON** (`POST /v1/payments/create/json`) and **S2S Redirect** (`POST /v1/payments/create/redirect`), including saved cards and tokens. Start with the [hub](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s.md) for keys and webhook setup.

## 1. Test Mode Coverage

### How live mode and test mode differ

| Behaviour | Live mode | Test mode |
| - | - | - |
| Authentication | Issuer ACS page (3DS) or Native OTP | Mock bank page with **Success** and **Failure** buttons. Any OTP of 4–10 digits succeeds; fewer than 4 digits fails. |
| Card numbers | Real cards | Test cards only. In live mode they fail with "card issuer is invalid". |
| Networks and international | As enabled on your live account | Set separately on your test account; it isn't copied from live mode. A disabled network returns `card_network_not_enabled`, and a disabled international setting returns `international_transaction_not_allowed`. |
| Webhook delivery | Razorpay sends the webhook once the gateway has authorised the payment. That round trip is real, so delivery can take minutes and your reconciler has to allow for it. | The gateway is simulated, so the webhook is sent as soon as the create-payment request succeeds, almost instantly. Do not use test mode to size your reconciliation windows or to judge how long to wait before polling. |

### What you can test

| Area | What you can test |
| - | - |
| Payments | Success, declines, cancel and timeout, using the cards in [Scenarios to test your integration](#3-scenarios-to-test-your-integration) and [3.3 Card error scenarios](#3-3-card-error-scenarios). |
| Authentication | 3DS redirect to the mock bank page, Native OTP, and authentication failures. |
| Saved cards and tokens | Save a card, pay with a token, network tokens, the tokenisation APIs (`POST /v1/tokens`, `/tokens/fetch`, `/tokens/delete`), and a one-time payment on a recurring token. |
| BIN / IIN lookup | `GET /v1/iins/:iin` for card and token IINs. |
| Reconciliation | Fetching a payment by ID and fetching the payments on an order, so you can prove your reconciler agrees with the webhook. |
| Capture | Manual capture of an authorised payment, for the full amount. Partial capture is coming soon. |
| Refunds | Full and partial refunds on a captured payment. |
| Webhooks | Payment, order, refund and token webhooks for each of the above. See [Webhooks: what fires, and what it lets you decide](#webhooks-what-fires-and-what-it-lets-you-decide). |
| Partial capture; Apple Pay, Card Sync, passkeys, CVV-less, fee bearer, debit card TPV, bulk BIN | Coming soon. See [3.4 Not available in test mode yet](#3-4-not-available-in-test-mode-yet). |

### Endpoint coverage in test mode

| API | Endpoint | Available on test mode |
| - | - | - |
| Create an order | `POST /v1/orders` | Available |
| Create a payment (S2S JSON) | `POST /v1/payments/create/json` | Available |
| Create a payment (S2S Redirect) | `POST /v1/payments/create/redirect` | Available |
| Check Native OTP support | `POST /v1/payment/flows` | Available |
| Generate, submit and resend OTP (S2S JSON V2, on-demand) | `POST /v1/payments/:id/otp_generate`, `/otp/submit`, `/otp/resend` | Available |
| Fetch a payment | `GET /v1/payments/:id` | Available |
| Fetch card details of a payment | `GET /v1/payments/:id/card` | Available |
| Fetch payments on an order | `GET /v1/orders/:id/payments` | Available |
| Capture a payment (full amount) | `POST /v1/payments/:id/capture` | Available |
| Capture part of a payment (partial capture) | `POST /v1/payments/:id/capture` with a lower `amount` | Coming soon |
| Refund a payment | `POST /v1/payments/:id/refund` | Available |
| Saved-card tokens | `GET /v1/customers/:id/tokens`, `DELETE …/tokens/:token_id` | Available |
| Tokenisation APIs (on-demand) | `POST /v1/tokens`, `/tokens/fetch`, `/tokens/delete` | Available |
| IIN lookup (on-demand) | `GET /v1/iins/:iin` | Available |

### Webhooks: what fires, and what it lets you decide

Every webhook this flow fires in live mode is listed below, along with whether it also fires in test mode. Test mode webhooks have the same shape as live mode ones and are delivered to the URL set in your test mode Dashboard.

| Webhook | Fires when | In test mode |
| - | - | - |
| `payment.authorized` | The payment is authorised. The money is held, not captured. | Available |
| `payment.captured` | The payment is captured. | Available |
| `payment.failed` | The payment attempt fails. | Available |
| `order.paid` | The order is fully paid. | Available |
| `refund.created` | A refund is accepted. | Available |
| `refund.processed` | A refund has left Razorpay. | Available |
| `refund.failed` | A refund could not be processed. | Coming soon |
| `token.initiated`, `token.activated` | A card is being tokenised, then the token is usable. | Available |
| `token.deactivated` | A token is deleted. | Available |
| `token.confirmed`, `token.rejected` | A recurring (mandate) token is confirmed or rejected. | Available |
| `token.expiry_updated`, `token.suspended` | The network updates or suspends a token. | Live only |

### Which webhooks each scenario fires

Card events arrive in an order that matters, and each one entitles you to do something different. Most integration bugs that reach production are not missing webhooks; they are acting on the wrong one.

<table>
  <thead><tr><th>Scenario</th><th>Webhooks, in order</th><th>What each one lets you decide</th><th>In test mode</th></tr></thead>

  <tbody>
    <tr><td>**1** Successful payment</td><td>`payment.authorized`, `payment.captured`, `order.paid`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.</td><td>Available</td></tr>
    <tr><td>**2–4** Declined, cancelled, timed out</td><td>`payment.failed`</td><td>`payment.failed` — This attempt is over. The error `reason` tells you whether to offer the same method again or move the customer to another one.</td><td>Available</td></tr>
    <tr><td>**6** 3DS redirect</td><td>`payment.authorized`, `payment.captured`, `order.paid`, `payment.failed`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.\
    `payment.failed` — This attempt is over. The error `reason` tells you whether to offer the same method again or move the customer to another one.</td><td>Available</td></tr>
    <tr><td>**7** Manual capture</td><td>`payment.authorized`, `payment.captured`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.</td><td>Available</td></tr>
    <tr><td>**8** Full and partial refund</td><td>`refund.created`, `refund.processed`, `refund.failed`</td><td>`refund.created` — The refund is accepted, not settled. Do not tell the customer the money is back yet.\
    `refund.processed` — The money has left Razorpay. This is when you confirm the refund to the customer.\
    `refund.failed` — The refund did not go through. It needs a retry or a manual payout — it will not resolve itself.</td><td>Available (`refund.failed` coming soon)</td></tr>
    <tr><td>**9** Native OTP</td><td>`payment.authorized`, `payment.captured`, `order.paid`, `payment.failed`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.\
    `payment.failed` — This attempt is over. The error `reason` tells you whether to offer the same method again or move the customer to another one.</td><td>Available</td></tr>
    <tr><td>**10** Save a card</td><td>`payment.authorized`, `payment.captured`, `order.paid`, `token.initiated`, `token.activated`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.\
    `token.initiated` — Tokenisation has started but the card is not yet usable. Wait for `token.activated`.\
    `token.activated` — The saved card is usable. Show it to the customer now, not before.</td><td>Available</td></tr>
    <tr><td>**11, 12** Pay with a saved or network token</td><td>`payment.authorized`, `payment.captured`, `order.paid`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.</td><td>Available</td></tr>
    <tr><td>**13** Create, fetch and delete tokens</td><td>`token.initiated`, `token.activated`, `token.deactivated`</td><td>`token.initiated` — Tokenisation has started but the card is not yet usable. Wait for `token.activated`.\
    `token.activated` — The saved card is usable. Show it to the customer now, not before.\
    `token.deactivated` — The saved card is gone. Remove it from your UI or the customer will pick a card that cannot pay.</td><td>Available</td></tr>
    <tr><td>**14** One-time on a recurring token</td><td>`payment.authorized`, `token.confirmed`, `token.rejected`, `payment.captured`, `order.paid`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.\
    `token.confirmed` — The mandate is live. Only now can you schedule debits against it.\
    `token.rejected` — Registration failed. The customer has to start again — do not retry against this token.\
    `payment.captured` — Funds are yours, fulfil services on this.\
    `order.paid` — The order is settled and will not accept another payment. Close the cart and stop any retry loop.</td><td>Available</td></tr>
    <tr><td>**16–45** Every card error scenario</td><td>`payment.failed`</td><td>`payment.failed` — This attempt is over. The error `reason` tells you whether to offer the same method again or move the customer to another one.</td><td>Available</td></tr>
    <tr><td>**75** Late authorisation</td><td>`payment.authorized`</td><td>`payment.authorized` — Funds are held for you but they're not yet yours. Do not fulfil services on this alone.</td><td>Live only</td></tr>
  </tbody>
</table>

### Before you trust any of them

* **Verify the signature on every event.** Replay one event to your endpoint and send one with a changed body. The replay must be ignored and the tampered event rejected. An endpoint that skips this is an open write to your order state.
* **Expect duplicates.** The same event can arrive more than once. Key your handler on the event ID and make it idempotent.
* **Order is not guaranteed across events.** Do not assume `payment.captured` lands before `order.paid`; handle whichever arrives first.
* **Webhook first, callback second.** The browser callback can be lost, blocked or forged. Fulfil on the webhook.

## 2. Before You Begin

* Generate your test mode API keys from the Dashboard. Keys that start with `rzp_test_` send all requests to test mode. You do not need to enable any separate flag.
* Use the same APIs and request formats you use in live mode. Only the API keys change.
* Configure a [webhook](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/webhooks-and-fetch-apis.md) URL in your test mode Dashboard to receive test events. Test mode webhooks are separate from live mode ones and do not carry over.
* Ask us to enable the on-demand features you use (S2S JSON V2 for Native OTP, the IIN API, the tokenisation APIs) on your test account. They are enabled separately from live mode, so ask for both.
* **Every scenario on this page needs an order.** Order behaviour has scenarios of its own, all on [Orders](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md). The ones that matter here: [ORD-01](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) create · [ORD-02](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) lifecycle · [ORD-03](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) retry after a failure · [ORD-04](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) signature · [ORD-05](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) idempotent create · [ORD-06](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) fetch · [ORD-07](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) already paid · [ORD-16](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) partial payments. Request errors ([ORD-08 to ORD-15](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md)) are the same for every method; run them once.

In test mode the card number that you use decides the outcome, because there is no real issuer on the other end. Pay with a success card and approve on the mock bank page, and the payment succeeds. Pay with one of the failure cards in [3.3 Card error scenarios](#3-3-card-error-scenarios) and choose **Failure**, and the payment fails with the error mapped to that card.

* Use any future expiry date and any 3-digit CVV (4 digits for Amex).
* On the mock bank page, enter any OTP of 4–10 digits, or choose **Success**, to approve. An OTP of fewer than 4 digits fails.
* For a specific error, pay with its card from 3.3 and choose **Failure**. Any other card + **Failure** returns `gateway_technical_error`.

Any amount works; the card number that you use decides the outcome.

### Success cards

| Network | Sub type | Credit | Debit | Prepaid |
| - | - | - | - | - |
| Visa | Consumer | `4072 0000 0000 1003` | `4100 2800 0000 1007` | `4091 0000 0000 1000` |
| Visa | Business | `4509 0000 0000 1006` | `4002 1000 0000 1006` | n/a |
| Mastercard | Consumer | `5320 0000 0000 1000` | `5468 0000 0000 1002` | `5180 2872 0009 1001` |
| Mastercard | Business | `5555 5100 0008 1006` | `5134 9000 0000 1007` | n/a |
| RuPay | Consumer | `6527 6589 0000 1005` | `6070 0000 0000 1000` | `5089 0000 0000 1001` |
| RuPay | Business | `6531 0000 0000 1003` | n/a | n/a |
| American Express | Consumer | `3402 560004 01007` | n/a | n/a |
| American Express | Business | `3748 500000 01004` | n/a | n/a |
| Diners Club | Consumer | `3608 280009 1007` | n/a | n/a |
| Diners Club | Business | `3612 751100 1009` | n/a | n/a |

### Cards for specific flows

| Use it to test | Card number | Notes |
| - | - | - |
| Native OTP: card that supports it | `4895 1911 1111 1115` | Use in scenario 9 |
| Native OTP: card that doesn't support it | `4386 2894 0766 0153` | `/v1/payment/flows` returns `otp: false`; use 3DS |
| International card | `4012 8888 8888 1881` | — |
| International card with billing address | `5105 1051 0510 5100` | Asks for a billing address |
| Card EMI | `5241 8100 0000 0000` | — |
| Recurring token (for scenario 14) | `4718 6091 0820 4366` | Visa; register with `recurring=1` |

## 3. Scenarios to Test Your Integration

This section lists every scenario we think is worth running against your card integration before you go live. They are grouped by what each one proves, rather than by how urgent they are, so that you can work down the page in order and know that you have covered the integration end to end.

* **Must-have**. We highly recommend running these scenarios first. They cover the successful payment, the 3DS redirect and the handful of outcomes you are almost certain to meet once you are live, so getting through them is the shortest route to an integration you can trust.
* **Other common scenarios**. These come up in normal day-to-day running: manual capture, refunds, Native OTP, saved cards and tokens, and the IIN lookup. They are not errors as such, but your integration still needs to recognise them and respond correctly, so we recommend covering the ones you use before launch.
* **Error scenarios**. These are failures you can bring on deliberately, with a failure test card or a bad API request, so that you can check your error handling without waiting for a real failure to happen. They are grouped by `error.source`, because the source tells you who has to act.
* **Not available in test mode yet**. These scenarios are real and your integration still has to handle them, but they cannot be reproduced in test mode today. We recommend reading through them and checking your handling on live traffic or in a controlled live test before you ship.

### 3.1 Must-build card scenarios

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**1**</td><td>Successful payment</td><td>`4100 2800 0000 1007`, any CVV, any future expiry. **Success**, or any 4–10 digit OTP.</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id`: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>Redirect the customer to the URL in `next[]` (JSON) or render the returned page (Redirect). On the mock bank page, enter any 4–10 digit OTP or choose **Success**.</li><li>The customer returns to your `callback_url` with `razorpay_payment_id`, `razorpay_order_id` and `razorpay_signature`. Verify the signature on your server.</li><li>Fulfil on `payment.captured`.</li><li>Webhooks received: `payment.authorized`, `payment.captured`, `order.paid`.</li><li>Status changes: the payment moves to `captured` (or `authorized` if you capture manually) and the order to `paid`.</li></ol></td></tr>
    <tr><td>**2**</td><td>Declined by bank</td><td>`4100 2800 0005 0004` + **Failure**</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_declined`. The customer sees `error.description` and can try another card.</li><li>Status changes: the payment moves to `failed`; the order stays `attempted` for a retry.</li></ol></td></tr>
    <tr><td>**3**</td><td>Customer cancels</td><td>`4100 2800 0007 0002` + **Failure**</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure** (or close the bank page).</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `payment_cancelled`. The order stays open for a retry.</li></ol></td></tr>
    <tr><td>**4**</td><td>Payment times out or session expires</td><td>`4100 2800 0009 0000`, `4100 2800 0003 0048` + **Failure**</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `payment_timed_out` on the first card and `payment_session_expired` on the second. Don't fulfil; keep the order open.</li></ol></td></tr>
    <tr><td>**5**</td><td>Fetch payment and reconcile</td><td>A payment ID from **1** (success) and one from **2** (failure)</td><td><ol><li>Call `GET /v1/payments/:id` after each scenario.</li><li>Confirm the status matches the webhook.</li><li>Call it with a wrong ID, or a test payment ID with your live keys: confirm `BAD_REQUEST_ERROR` with reason `input_validation_failed` ("The id provided does not exist").</li><li>Call `GET /v1/payments/:id/card` on a non-card payment: confirm `BAD_REQUEST_ERROR` "Payment was not done using card" (reason not set).</li><li>Webhooks received: none.</li></ol></td></tr>
    <tr><td>**6**</td><td>3DS: redirect to the bank page</td><td>Any success card</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment and redirect to the URL in `next[]` (JSON) or render the returned page (Redirect).</li><li>Enter a 4–10 digit OTP: the payment succeeds. Repeat with fewer than 4 digits: the payment fails.</li><li>Confirm the customer returns to your `callback_url` both times.</li><li>Webhooks received: success `payment.authorized`, `payment.captured`, `order.paid`; failure `payment.failed`.</li><li>For specific authentication errors, use the cards in [3.3](#3-3-card-error-scenarios).</li></ol></td></tr>
  </tbody>
</table>

Repeat scenario 1 with each failure card to cover the card error scenarios in 3.3. Use the same order for a failed attempt and the retry that follows it.

### 3.2 Common scenarios in cards

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**7**</td><td>Manual capture (full amount)</td><td>Any success card, with manual capture</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) with `payment_capture: false` (or set manual capture in your test mode Dashboard).</li><li>Pay with a success card and approve on the mock bank page.</li><li>Confirm the payment is `authorized`, not `captured`. Webhooks received: `payment.authorized`.</li><li>Capture the full amount: `POST /v1/payments/:id/capture` with the same `amount` and `currency`.</li><li>Webhooks received: `payment.captured`. Status changes: the payment moves to `captured`.</li><li>Fulfil only after `payment.captured`. Partial capture isn't in test mode yet (see [3.4](#3-4-not-available-in-test-mode-yet)).</li></ol></td></tr>
    <tr><td>**8**</td><td>Full and partial refund</td><td>A captured payment from scenario 1</td><td><ol><li>Refund one payment in full and another in part: `POST /v1/payments/:id/refund`.</li><li>Webhooks received: `refund.created`, `refund.processed` (or `refund.failed` if the refund fails).</li><li>Status changes: the payment shows `refund_status` as full or partial; the order stays `paid`.</li><li>Refund errors are on the [Refunds](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/refunds.md) page.</li></ol></td></tr>
    <tr><td>**9**</td><td>Native OTP: generate, submit, resend (S2S JSON V2, on-demand)</td><td>`4895 1911 1111 1115` (supports Native OTP)</td><td><ol><li>Optional: check the card supports Native OTP with `POST /v1/payment/flows`.</li><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with `POST /v1/payments/create/json`, the `order_id` and `auth_type=otp`.</li><li>Call `POST /v1/payments/:id/otp_generate` (the URL is in `next[]`), show your OTP screen, and submit with `POST /v1/payments/:id/otp/submit`. Any 4–10 digit OTP succeeds.</li><li>Resend once with `otp/resend`, then submit again.</li><li>Verify `razorpay_signature` from the successful submit.</li><li>Webhooks received: `payment.authorized`, `payment.captured`, `order.paid`. A wrong OTP sends no webhook; `payment.failed` comes only when the payment finally fails.</li><li>Errors to test: [Native OTP API errors](#native-otp-api-errors) in 3.3.</li></ol></td></tr>
    <tr><td>**10**</td><td>Save a card during payment</td><td>Any success card + `save=1` + `customer_id`</td><td><ol><li>Create a customer: `POST /v1/customers`.</li><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Pay on `POST /v1/payments/create/json` with `save=1` and the `customer_id`.</li><li>Confirm the token appears in `GET /v1/customers/:id/tokens`.</li><li>Webhooks received: `payment.authorized`, `payment.captured`, `order.paid`. With the tokenisation APIs, also `token.initiated`, `token.activated`.</li><li>Send a `customer_id` that doesn't exist or belongs to another account: confirm `BAD_REQUEST_ERROR` "The id provided does not exist or access is unauthorised" (reason not set).</li><li>If the issuer doesn't support tokenisation, you get `card_not_eligible`. No test card triggers it.</li></ol></td></tr>
    <tr><td>**11**</td><td>Pay with a saved token</td><td>Token from scenario 10 + CVV</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Pay with `customer_id`, the `token` and the CVV.</li><li>Confirm success without the card number.</li><li>Webhooks received: `payment.authorized`, `payment.captured`, `order.paid`.</li><li>Send a `token` that doesn't exist or belongs to another customer: confirm `invalid_token`.</li><li>Send a 2-digit CVV: confirm `card_cvv_invalid`.</li></ol></td></tr>
    <tr><td>**12**</td><td>Pay with your own network token (token requestors only)</td><td>Your network token + cryptogram</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with `card.tokenised=true`, `cryptogram_value`, `token_provider` and `provider_type=network`.</li><li>Webhooks received: `payment.authorized`, `payment.captured`, `order.paid`.</li><li>Leave out `cryptogram_value` or `token_provider`: confirm `input_validation_failed` naming the missing field.</li></ol></td></tr>
    <tr><td>**13**</td><td>Create, fetch and delete tokens (tokenisation APIs, on-demand)</td><td>Valid and invalid token requests</td><td><ol><li>Tokenisation APIs: call `POST /v1/tokens`, `/tokens/fetch` and `/tokens/delete`.</li><li>Saved cards: call `GET /v1/customers/:id/tokens`, `GET …/tokens/:token_id` and `DELETE …/tokens/:token_id`.</li><li>Webhooks received: create `token.initiated`, `token.activated`; delete `token.deactivated`. Sent by the network later: `token.expiry_updated`, `token.suspended`.</li><li>Errors to test: [Token API errors](#token-api-errors) in 3.3.</li></ol></td></tr>
    <tr><td>**14**</td><td>One-time payment on a recurring token (needs recurring enabled)</td><td>A recurring token (register with Visa `4718 6091 0820 4366`)</td><td><ol><li>Register the mandate: create a payment with `recurring=1` and `customer_id` on `POST /v1/payments/create/json` using the recurring test card. Wait for `token.confirmed`.</li><li>Create a new order, then pay with `customer_id` and `token`. Don't send `recurring` (or send `0`). CVV is optional for tokenised cards; don't send a dummy CVV.</li><li>Complete authentication from `next[]` (3DS on the mock bank page, or Native OTP as in scenario 9).</li><li>Confirm the payment succeeds, no pre-debit notification is sent, and the mandate stays active.</li><li>Webhooks received: registration `payment.authorized` (has the `token_id`), then `token.confirmed` or `token.rejected`; one-time `payment.authorized`, `payment.captured`, `order.paid`, and no `notification.delivered`.</li><li>Send a `token` that doesn't exist or belongs to another customer: confirm `invalid_token`.</li></ol></td></tr>
    <tr><td>**15**</td><td>Look up card details by IIN (IIN API, on-demand)</td><td>`GET /v1/iins/410028`</td><td><ol><li>Call `GET /v1/iins/:iin` before you create the payment, to check card type, international, EMI or recurring eligibility, or Native OTP support.</li><li>Send a 6-digit card IIN (all networks), e.g. `410028`: expect `tokenised_iin: false`, `card_iin: null`, plus network, type, sub\_type, issuer, international, `emi.available`, `recurring.available` and `authentication_types`.</li><li>Send a 9-digit token IIN (Visa, Mastercard, RuPay): expect `tokenised_iin: true` and `card_iin` set to the actual card IIN (Visa and Mastercard only), plus the same card details.</li><li>An American Express token IIN is 6 digits and returns `tokenised_iin: true`. Diners Club token IINs aren't supported.</li><li>Webhooks received: none.</li><li>Errors to test: [IIN API errors](#iin-api-errors) in 3.3.</li></ol></td></tr>
  </tbody>
</table>

### 3.3 Card error scenarios

Pay with the card and choose **Failure** on the mock bank page. Each card returns the error in its row. Branch your handling on `error.reason` and `error.source`, never on the description text. Errors from creating the order (bad `amount`, `currency`, `receipt` and so on) are on [Orders](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md).

#### Customer Errors

The customer entered something wrong, or their card or account stopped the payment. Wrong details and a wrong PIN are recoverable: ask them to re-enter. Expired, blocked or over-limit cards are not: ask for another card.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**16**</td><td>Authentication fails</td><td>`4100 2800 0000 0009` + **Failure**, or an OTP under 4 digits</td><td>code `GATEWAY_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `authentication_failed`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `authentication_failed` at `error.step` = `payment_authentication`, and a retry or another-card option.</li></ol></td></tr>
    <tr><td>**17**</td><td>Insufficient funds</td><td>`4100 2800 0008 0001` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `insufficient_funds`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `insufficient_funds` and a "try another card" message.</li></ol></td></tr>
    <tr><td>**18**</td><td>CVV in the wrong format</td><td>`4100 2800 0007 0051` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step —\
    reason `card_cvv_invalid`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_cvv_invalid` and a "re-enter the CVV" prompt.</li></ol></td></tr>
    <tr><td>**19**</td><td>Incorrect CVV</td><td>`4100 2800 0000 0033` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `incorrect_cvv`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `incorrect_cvv` and a "re-enter the CVV" prompt.</li></ol></td></tr>
    <tr><td>**20**</td><td>Card expired</td><td>`4100 2800 0009 0034` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `card_expired`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_expired` and a "use another card" message.</li></ol></td></tr>
    <tr><td>**21**</td><td>Incorrect expiry date</td><td>`4100 2800 0002 0049` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `incorrect_card_expiry_date`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `incorrect_card_expiry_date` and a "re-enter the expiry" prompt.</li></ol></td></tr>
    <tr><td>**22**</td><td>Incorrect card number</td><td>`4100 2800 0001 0008` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `card_number_invalid`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_number_invalid` and a "re-enter the card number" prompt.</li></ol></td></tr>
    <tr><td>**23**</td><td>Incorrect card details</td><td>`4100 2800 0001 0040` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `incorrect_card_details`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `incorrect_card_details` and a "check the card details" prompt.</li></ol></td></tr>
    <tr><td>**24**</td><td>Card not enrolled for online payments</td><td>`4100 2800 0004 0013` + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `customer`\
    step `card_enrollment_check`\
    reason `card_not_enrolled`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_not_enrolled` and a "use another card or contact your bank" message.</li></ol></td></tr>
    <tr><td>**25**</td><td>Card blocked</td><td>`4100 2800 0001 0032` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `debit_instrument_blocked`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `debit_instrument_blocked` and a "use another card" message.</li></ol></td></tr>
    <tr><td>**26**</td><td>Card inactive for online payments</td><td>`4100 2800 0005 0038` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `debit_instrument_inactive`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `debit_instrument_inactive` and a "use another card or contact your bank" message.</li></ol></td></tr>
    <tr><td>**27**</td><td>Incorrect PIN</td><td>`4100 2800 0002 0031` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `incorrect_pin`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `incorrect_pin` and a retry option.</li></ol></td></tr>
    <tr><td>**28**</td><td>PIN attempts exceeded</td><td>`4100 2800 0005 0046` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authentication`\
    reason `pin_attempts_exceeded`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `pin_attempts_exceeded` and a "try later or use another card" message, not a retry-PIN prompt.</li></ol></td></tr>
    <tr><td>**29**</td><td>Per-transaction limit exceeded</td><td>`4100 2800 0008 0035` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `transaction_limit_exceeded`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `transaction_limit_exceeded` and an "amount too high for this card" message.</li></ol></td></tr>
    <tr><td>**30**</td><td>Daily amount limit exceeded</td><td>`4100 2800 0009 0042` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `transaction_daily_limit_exceeded`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `transaction_daily_limit_exceeded` and a "daily limit reached, use another card" message.</li></ol></td></tr>
    <tr><td>**31**</td><td>Daily transaction count exceeded</td><td>`4100 2800 0008 0043` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `customer`\
    step `payment_authorization`\
    reason `transaction_daily_count_exceeded`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `transaction_daily_count_exceeded` and a "too many payments today, use another card" message.</li></ol></td></tr>
  </tbody>
</table>

#### Issuing Bank Errors

The bank declined the payment or had a problem of its own. A technical error is temporary, so offer a retry. A decline is the bank's decision, so ask for another card rather than retrying the same one.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**32**</td><td>Bank technical error</td><td>`4100 2800 0007 0036` + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `issuer_bank`\
    step `payment_authorization`\
    reason `bank_technical_error`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `bank_technical_error` and a retry option.</li></ol></td></tr>
    <tr><td>**33**</td><td>Card declined (other triggers)</td><td>`4100 2800 0006 0003`, `4100 2800 0004 0005` + **Failure**</td><td>on 0006 0003\
    code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_authorization`\
    reason `card_declined`\
    \
    on 0004 0005\
    code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_initiation`\
    reason `card_declined`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_declined` on both, and read `error.step`: one fails at initiation, the other at authorisation.</li></ol></td></tr>
    <tr><td>**34**</td><td>Declined by bank at authentication</td><td>`4100 2800 0004 0039` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_authentication`\
    reason `declined_by_bank`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `declined_by_bank` and a "try another card" message.</li></ol></td></tr>
    <tr><td>**35**</td><td>Card disabled for online payments</td><td>`4100 2800 0003 0006` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_authorization`\
    reason `card_disabled_for_online_payments`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_disabled_for_online_payments` and a "contact your bank or use another card" message.</li></ol></td></tr>
    <tr><td>**36**</td><td>Blocked by issuer</td><td>`4100 2800 0007 0044` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_authorization`\
    reason `issuer_declined`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `issuer_declined` and a "try another card" message.</li></ol></td></tr>
    <tr><td>**37**</td><td>Risk check failed</td><td>`4100 2800 0003 0030` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `issuer_bank`\
    step `payment_authorization`\
    reason `payment_risk_check_failed`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `payment_risk_check_failed` and a "try another card" message.</li></ol></td></tr>
    <tr><td>**38**</td><td>Card restricted</td><td>`4100 2800 0006 0045` + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `bank`\
    step `payment_authorization`\
    reason `card_restricted`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_restricted` and a "try another card" message.</li></ol></td></tr>
  </tbody>
</table>

#### Gateway Errors

Something went wrong between Razorpay and the bank. These are temporary, so offer the customer the same card again.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**39**</td><td>Gateway technical error</td><td>`4100 2800 0002 0007`, or any other test card + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `gateway`\
    step `payment_authorization`\
    reason `gateway_technical_error`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `gateway_technical_error` and a retry option.</li></ol></td></tr>
    <tr><td>**40**</td><td>Payment failed</td><td>`4100 2800 0006 0037` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source `gateway`\
    step `payment_authorization`\
    reason `payment_failed`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `payment_failed` and a retry option.</li></ol></td></tr>
  </tbody>
</table>

#### Business Errors

What you sent, or what is enabled on your account, stopped the payment. Fix it on your side; a retry by the customer won't help.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**41**</td><td>Card holder name in the wrong format</td><td>`4100 2800 0008 0050` + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `business`\
    step `payment_authentication`\
    reason `card_name_invalid`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `card_name_invalid`. Fix the name you send; don't ask the customer to retry the same input.</li></ol></td></tr>
    <tr><td>**42**</td><td>API validation errors (all methods)</td><td>Missing `amount`, `amount: 0`, wrong key secret</td><td>missing field\
    code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`\
    \
    amount 0\
    code `BAD_REQUEST_ERROR`\
    reason `invalid_amount`\
    \
    wrong key\
    code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Send each bad request to `POST /v1/payments/create/json`.</li><li>Confirm HTTP 4xx (401 on a wrong key), no payment created and no webhook.</li></ol></td></tr>
    <tr><td>**43**</td><td>Network or international card not enabled</td><td>Amex `3402 560004 01007`, international `4012 8888 8888 1881`</td><td>on Amex\
    code `BAD_REQUEST_ERROR`\
    reason `card_network_not_enabled`\
    \
    on international\
    code `BAD_REQUEST_ERROR`\
    reason `international_transaction_not_allowed`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Pay with each card while that network, or international payments, is disabled on your test account.</li><li>Confirm `card_network_not_enabled` / `international_transaction_not_allowed` and a "use another card" message.</li></ol></td></tr>
  </tbody>
</table>

#### Internal Errors

These come back with a Razorpay internal source, or no source yet. Treat them as temporary and offer a retry.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**44**</td><td>Transaction not permitted</td><td>`4100 2800 0000 0041` + **Failure**</td><td>code `GATEWAY_ERROR`\
    source `internal`\
    step `payment_initiation`\
    reason `Transaction not permitted to issuer/cardholder`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm the error and a retry option.</li></ol></td></tr>
    <tr><td>**45**</td><td>Authentication attempts exceeded</td><td>`4100 2800 0004 0047` + **Failure**</td><td>code `BAD_REQUEST_ERROR`\
    source —\
    step —\
    reason `acs_maximum_attempts_reached`</td><td><ol><li>[Create an order](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md) (`POST /v1/orders`) and store the returned `order_id`.</li><li>Create the payment with that `order_id` and the trigger card, any future expiry and any CVV: `POST /v1/payments/create/json` or `/create/redirect`.</li><li>On the mock bank page, choose **Failure**.</li><li>Webhooks received: `payment.failed`.</li><li>Confirm `acs_maximum_attempts_reached` and a "try later or use another card" message.</li></ol></td></tr>
  </tbody>
</table>

#### Native OTP API errors

Request errors on the OTP calls in scenario 9. They don't fail the payment and send no webhook; fix the request, or let the customer re-enter.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**46**</td><td>Wrong OTP</td><td>OTP under 4 digits on `otp/submit`</td><td>code `BAD_REQUEST_ERROR`\
    reason `incorrect_otp`</td><td><ol><li>Submit an OTP with fewer than 4 digits.</li><li>Confirm the payment isn't failed: the response has `action=RETRY` and `next[]`. Show the OTP screen again with resend.</li><li>Expect HTTP 400 and the description "Payment processing failed because of incorrect OTP". No webhook.</li></ol></td></tr>
    <tr><td>**47**</td><td>OTP missing from submit</td><td>`otp/submit` with no `otp`</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Call `otp/submit` with no `otp` in the body.</li><li>Expect HTTP 400 and the description "Request is expected in JSON but is in incorrect format". No webhook.</li></ol></td></tr>
    <tr><td>**48**</td><td>OTP generated twice</td><td>`otp_generate` twice</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Call `otp_generate` twice for the same payment.</li><li>Expect HTTP 400 and the description "Something went wrong, please try again after sometime". No webhook.</li></ol></td></tr>
    <tr><td>**49**</td><td>Resend on a non-OTP payment</td><td>`otp/resend` without `auth_type=otp`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Call resend on a payment that wasn't created with `auth_type=otp`.</li><li>Until the error-mapping fix ships, this returns reason `auth type not supported` and the description "Auth type is invalid." Until then, branch on HTTP 400 and `error.code` for this error, not on the reason.</li><li>Expect HTTP 400 and the description "The auth\_type sent is not supported for this payment. Use 3ds, or enable headless OTP (auth\_type otp) or direct debit (auth\_type skip) for your account and check the card supports it". No webhook.</li></ol></td></tr>
    <tr><td>**50**</td><td>Submit after success</td><td>`otp/submit` again</td><td>code `BAD_REQUEST_ERROR`\
    reason `gateway_technical_error`</td><td><ol><li>Call submit again after the payment has succeeded.</li><li>Expect HTTP 400 and the description "The payment has already been processed". No webhook.</li></ol></td></tr>
    <tr><td>**51**</td><td>Wrong payment ID on OTP calls</td><td>A wrong `payment_id`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Call `otp_generate` or `otp/submit` with a wrong `payment_id`.</li><li>Expect HTTP 400 and the description "The id provided does not exist". No webhook.</li></ol></td></tr>
  </tbody>
</table>

#### Token API errors

Request errors on the tokenisation and saved-card token APIs in scenario 13. Rows marked live mode only can't be reproduced in test mode.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**52**</td><td>Create: required field missing</td><td>`POST /v1/tokens` without e.g. `number`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Leave out a required field.</li><li>Expect HTTP 400 and the description "The \<field name> is required". No webhook.</li></ol></td></tr>
    <tr><td>**53**</td><td>Create: field in the wrong format</td><td>`POST /v1/tokens`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send a field in the wrong format.</li><li>Expect HTTP 400 and the description "The \<field name> is invalid". No webhook.</li></ol></td></tr>
    <tr><td>**54**</td><td>Create: invalid card number</td><td>`POST /v1/tokens`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send an invalid card number.</li><li>Expect HTTP 400 and the description "The card number is invalid". No webhook.</li></ol></td></tr>
    <tr><td>**55**</td><td>Create: CVV length</td><td>`POST /v1/tokens` with a 2- or 5-digit `cvv`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send a 2-digit or 5-digit `cvv`.</li><li>Expect HTTP 400 and the description "The cvv must be between 3 and 4 digits". No webhook.</li></ol></td></tr>
    <tr><td>**56**</td><td>Fetch: token ID doesn't exist (live mode only)</td><td>`POST /v1/tokens/fetch`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send an `id` that doesn't exist, has no `token_` prefix, or belongs to another account.</li><li>Expect HTTP 400 and the description "The id provided does not exist". No webhook.</li></ol></td></tr>
    <tr><td>**57**</td><td>Fetch: badly formed token ID (live mode only)</td><td>`POST /v1/tokens/fetch`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send `token_` followed by the wrong number of characters.</li><li>Expect HTTP 400 and the description "\<id> is not a valid id". No webhook.</li></ol></td></tr>
    <tr><td>**58**</td><td>Fetch: extra field sent (live mode only)</td><td>`POST /v1/tokens/fetch`</td><td>code `BAD_REQUEST_ERROR`\
    reason `extra_field_sent`</td><td><ol><li>Send any field other than `id` in the body.</li><li>Expect HTTP 400 and the description "\<field> is/are not required and should not be sent". No webhook.</li></ol></td></tr>
    <tr><td>**59**</td><td>Fetch: card not compliant (live mode only)</td><td>`POST /v1/tokens/fetch`</td><td>code `BAD_REQUEST_ERROR`\
    reason `card_not_compliant`</td><td><ol><li>Fetch a token for a card that isn't network-tokenised.</li><li>Expect HTTP 400 and the description "the saved card is no longer compliant with RBI guidelines. Please use another card/payment". No webhook.</li></ol></td></tr>
    <tr><td>**60**</td><td>Fetch: token not found</td><td>`POST /v1/tokens/fetch`</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Send a token ID that doesn't exist or was deleted.</li><li>Expect HTTP 400 and the description "Token not found". No webhook.</li></ol></td></tr>
    <tr><td>**61**</td><td>Delete: token not found</td><td>`POST /v1/tokens/delete`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Send an `id` that doesn't exist, has no `token_` prefix, is badly formatted, belongs to another account, or was already deleted.</li><li>Expect HTTP 400 and the description "Token not found". No webhook.</li></ol></td></tr>
    <tr><td>**62**</td><td>Delete: API not enabled (live mode only)</td><td>`POST /v1/tokens/delete`</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Call it when the tokenisation APIs aren't enabled on your account.</li><li>Expect HTTP 400 and the description "The requested URL was not found on the server". No webhook.</li></ol></td></tr>
    <tr><td>**63**</td><td>Saved card: ID doesn't exist</td><td>`/v1/customers/:id/tokens`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Use a `customer_id` or `token_id` that doesn't exist, belongs to another account, or was already deleted.</li><li>Expect HTTP 400 and the description "The id provided does not exist". No webhook.</li></ol></td></tr>
    <tr><td>**64**</td><td>Saved card: badly formed ID</td><td>`/v1/customers/:id/tokens`</td><td>code `BAD_REQUEST_ERROR`\
    reason `input_validation_failed`</td><td><ol><li>Use an ID with the wrong length.</li><li>Expect HTTP 400 and the description "\<id> is not a valid id". No webhook.</li></ol></td></tr>
    <tr><td>**65**</td><td>Saved card: token of another customer</td><td>`/v1/customers/:id/tokens/:token_id`</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Use a token that belongs to a different customer of yours. The error names the `id` field.</li><li>Expect HTTP 400 and the description "Token not found for id: \<token\_id> customer id: \<customer\_id>". No webhook.</li></ol></td></tr>
  </tbody>
</table>

#### IIN API errors

Request errors on the IIN lookup in scenario 15.

<table>
  <thead><tr><th>#</th><th>Scenario</th><th>Trigger creds</th><th>Error object</th><th>Steps to follow</th></tr></thead>

  <tbody>
    <tr><td>**66**</td><td>IIN doesn't exist</td><td>`GET /v1/iins/000000`</td><td>code `BAD_REQUEST_ERROR`\
    reason `iin_does_not_exist`</td><td><ol><li>Send an IIN that doesn't exist, e.g. `000000`.</li><li>Expect HTTP 400 and the description "IIN 000000 does not exist". No webhook.</li></ol></td></tr>
    <tr><td>**67**</td><td>Card IIN of the wrong length</td><td>`GET /v1/iins/41002`</td><td>code `BAD_REQUEST_ERROR`\
    reason `invalid_iin_length`</td><td><ol><li>Send a card IIN that isn't 6 digits.</li><li>Expect HTTP 400 and the description "The requested IIN is a card IIN & should be 6 digits long". No webhook.</li></ol></td></tr>
    <tr><td>**68**</td><td>Token IIN of the wrong length</td><td>`GET /v1/iins/:token_iin`</td><td>code `BAD_REQUEST_ERROR`\
    reason `invalid_iin_length`</td><td><ol><li>Send a Visa, Mastercard or RuPay token IIN that isn't 9 digits.</li><li>Expect HTTP 400 and the description "The requested IIN is a token IIN & should be 9 digits long". No webhook.</li></ol></td></tr>
    <tr><td>**69**</td><td>IIN API not enabled</td><td>`GET /v1/iins/:iin`</td><td>code `BAD_REQUEST_ERROR`\
    reason not set</td><td><ol><li>Call it before the IIN API is enabled on your account.</li><li>Expect HTTP 400 and the description "The requested URL was not found on the server". No webhook.</li></ol></td></tr>
  </tbody>
</table>

**not set** means Razorpay doesn't return an `error.reason` for that error today. Branch on the HTTP status and `error.code` instead.

The full list of card error reasons, including the 37 no test card reproduces, is on the [Error index](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/error-index.md). Mandate errors are on [Card recurring](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/recurring/card-recurring.md).

### 3.4 Not available in test mode yet

| # | Scenario | What your integration has to do, and what to assert |
| - | - | - |
| **70** | Partial capture Coming soon | Capture less than the authorised amount. Check in a small live test. Full manual capture is available in test mode: scenario 7. |
| **71** | CVV-less saved card payments Coming soon | Check in a small live test. |
| **72** | Apple Pay, Card Sync (CRED, Google) Coming soon | Check in a small live test. |
| **73** | Visa and Mastercard passkeys Coming soon | Check in a small live test. |
| **74** | Customer fee bearer (convenience fee) Coming soon | Check in a small live test. |
| **75** | Late authorisation Live only | Handle `payment.authorized` arriving after you showed a failure (up to 3 days). It happens on cards when the bank's 3DS response is delayed. Check in a controlled live test. |

## 4. Common Integration Gaps to Avoid

These are the mistakes that most often cause failed payments, missed debits or double charges after go-live. "Test with" points to the scenario that proves you've handled it.

### Webhook and token updates

| Gap | What goes wrong in production | What to do | Test with |
| - | - | - | - |
| Fulfilling on the checkout callback | The customer closes the bank page or loses network after paying. You never get the callback, so a paid order looks unpaid. | Fulfil on `payment.captured` or `order.paid`. Treat the callback as a hint, not proof. | 1, [Webhooks](#webhooks-what-fires-and-what-it-lets-you-decide) |
| Saved card marked usable too early | The card shows as saved but the first token payment fails because the network token isn't active yet. | Mark the card usable only after `token.activated`. Remove it on `token.deactivated`; update or hide it on `token.expiry_updated` and `token.suspended`. | 10, 13 |
| Duplicate or unsigned events processed | One payment fulfils twice, or a forged event marks an order paid. | Verify `X-Razorpay-Signature`. Store event IDs and skip repeats. | [Webhooks](#webhooks-what-fires-and-what-it-lets-you-decide) |

### Error handling and messaging to the payer

| Gap | What goes wrong in production | What to do | Test with |
| - | - | - | - |
| Showing raw codes | The customer sees `BAD_REQUEST_ERROR` and drops off. | Show `error.description`. It is written for the customer. | 16–69 |
| Same message for every failure | A customer whose card was declined retries the same card again and again. | Branch on `error.reason` and `error.source`: ask for another card on issuer declines, ask to re-enter on wrong details, offer a plain retry on technical errors. | 17, 2, 32 |
| Wrong OTP treated as failure | With Native OTP, a wrong OTP returns `action=RETRY`, but the integration ends the payment. | On `incorrect_otp` with `action=RETRY`, show the OTP screen again with resend. | 9 |

### 3DS, OTP and saved cards

| Gap | What goes wrong in production | What to do | Test with |
| - | - | - | - |
| Building the bank page URL yourself | You hard-code or rebuild the 3DS URL and the customer lands on an error page. | Redirect to the URL in `next[]` (S2S JSON) or render the returned page (S2S Redirect), as is. | 6 |
| Sending a dummy CVV on a tokenised card | You send a placeholder CVV for a saved or recurring token and the payment fails validation. | CVV is optional for tokenised cards. Leave it out rather than sending a dummy value. | 11, 14 |

### Fetch API when webhooks are late

| Gap | What goes wrong in production | What to do | Test with |
| - | - | - | - |
| Marking the order failed when nothing arrives | The bank responds slowly. You mark the order failed and the payment captures minutes later. | If no webhook arrives within a minute, poll `GET /v1/payments/:id` or `GET /v1/orders/:id/payments`. Treat the API as the source of truth. | 5 |
| No reconciliation job | Payments captured during a webhook outage never reach your system. | Run a periodic job that fetches orders still `attempted` and reconciles them. | 5 |
| Late authorisation ignored | A payment marked failed is authorised by the bank later. The customer is debited and you have no order. | Listen for `payment.authorized` for 3 days. Capture and fulfil, or let it auto-refund. See [Late authorisation ↗](https://razorpay.com/docs/payments/payments/late-authorisation.md). | scenario 75 Live only |

### Capture & refunds

| Gap | What goes wrong in production | What to do | Test with |
| - | - | - | - |
| Not capturing an authorised payment in time | Uncaptured `authorized` payments are auto-refunded — the customer is debited and then refunded, and you treat it as a failure. | Capture within the capture window or enable auto-capture; expect `refund.processed` if you don't. | BP-14, 7 |
| Multiple payments on the same order | More than one attempt succeeds or late-authorises on the same order, so the customer is charged twice. | Use the Orders API — it clubs attempts to one order; the duplicate or late-authorised payment auto-refunds and only one is marked paid. | BP-08, BP-09 |
| Confirming a refund too early | You tell the customer the money is back on `refund.created`, and the refund later fails. | Confirm the refund to the customer only on `refund.processed`. | 8 |

## 5. Best Integration Practices

These apply to every Razorpay integration. "On this method" says what each one means here; "Test it" links to where it is tested once for every method.

<table>
  <thead><tr><th>Topic</th><th>What to know</th><th>On this method</th><th>Test it</th><th>Read more</th></tr></thead>

  <tbody>
    <tr><td>**Difference between order and payment**</td><td>An **order** is what you want to collect. A **payment** is one attempt to pay it. One order can have many attempts but only one captured payment. Create the order on your server so the amount can't be tampered with.</td><td>A declined card and the retry with another card are two payments on one order.</td><td>[BP-24, BP-25](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md)</td><td>[Difference between order and payment ↗](https://razorpay.com/docs/payments/orders/#order-and-payment-flows)</td></tr>
    <tr><td>**Order states**</td><td>Orders move `created` → `attempted` → `paid`. An order stays `attempted` through failed attempts, and stays `paid` even after a refund. Handle Orders API errors (for example an invalid amount or currency) when you create the order.</td><td>Run scenario 17 then scenario 1 on the same order: the order should go `attempted` → `paid`.</td><td>[Payment states](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md) · [Orders errors](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/orders.md)</td><td>[Order states ↗](https://razorpay.com/docs/payments/orders/#order-states)\
    [Orders API error codes ↗](https://razorpay.com/docs/api/orders/create.md#errors)</td></tr>
    <tr><td>**Late authorisation**</td><td>A payment with no bank response is marked `failed` after 10 minutes, but Razorpay keeps polling the bank for 3 days. If the bank confirms, the payment becomes `authorized` (under 0.5% of payments). Listen for `payment.authorized` and capture it, or let it auto-refund.</td><td>Less common on cards, but it happens when the bank's 3DS response is delayed.</td><td>[BP-06](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md)</td><td>[Late authorisation ↗](https://razorpay.com/docs/payments/payments/late-authorisation.md)</td></tr>
    <tr><td>**Capture settings**</td><td>Choose auto-capture or manual capture and set the timeouts. An `authorized` payment you don't capture in time is auto-refunded. You can set capture behaviour per order through the Orders API.</td><td>Manual and partial capture Coming soon in test mode. Check them in a small live test.</td><td>[BP-14](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md)</td><td>[Capture settings ↗](https://razorpay.com/docs/payments/payments/capture-settings.md)</td></tr>
    <tr><td>**Multiple payments on the same order**</td><td>Once an order is `paid`, no more payments are accepted on it. While a payment on the order is `authorized`, a new attempt isn't allowed. An attempt that authorises late on a paid order is auto-refunded. Retry on the **same** order so a customer can't pay twice.</td><td>Reuse the order when the customer retries after a decline.</td><td>[BP-09](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md) · [BP-08](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices)</td><td>[Multiple payments on the same order ↗](https://razorpay.com/docs/payments/orders/#order-states)</td></tr>
  </tbody>
</table>

**All best practices:** [Overview](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices) · [Webhooks](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/webhooks-and-fetch-apis.md) · [Fetch APIs and reconciliation](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/webhooks-and-fetch-apis.md) · [Payment states and late authorisation](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/payment-states-and-late-authorisation.md) · [Error handling](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/error-handling.md) · [Downtime handling](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/downtime-handling.md) · [Security](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/test-s2s/best-practices/security.md)
