> ## 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.

# Integrate Card EMI

> Integrate Card EMI with the Razorpay Server-to-Server (S2S) integration. Fetch EMI plans, create an order and a payment, and verify the payment signature.

Available in
🇮🇳 India

Card EMI lets your customers pay for a purchase in Equated Monthly Instalments (EMIs) on their credit or debit card. The customer picks a bank and a tenure, and the card issuer converts the payment into EMIs.

With the S2S integration, you collect the card details and EMI choice on your own checkout page and send them to Razorpay from your server. Razorpay returns a URL where the customer authenticates the payment with their bank.

> [!NOTE]
>
> **Handy Tips**
>
> Contact our Support team to enable S2S Card EMI and the banks you want for your account.

## Integration Steps

Follow these steps to integrate Card EMI:

1. [Fetch EMI Plans](#11-fetch-emi-plans)
2. [Create an Order](#12-create-an-order)
3. [Create a Payment](#13-create-a-payment)
4. [Handle Payment Success and Error Events](#14-handle-payment-success-and-error-events)
5. [Fetch Payment Details and Status](#15-fetch-payment-details-and-status)
6. [Verify Payment Signature](#16-verify-payment-signature)
7. [Integrate Payments Rainy Day Kit](#17-integrate-payments-rainy-day-kit)
8. [Verify Payment Status](#18-verify-payment-status)

### 1.1 Fetch EMI Plans

Use the Methods API to get the EMI banks, tenures, interest rates and processing fees available to your account. Show the customer only what this API returns.

This API uses only your API key id, passed as the `key_id` query parameter. Do not send your key secret.

**Endpoint:** `GET https://api.razorpay.com/v1/methods`

```bash Request theme={null}
curl -X GET 'https://api.razorpay.com/v1/methods?key_id=[YOUR_KEY_ID]'
```

The response contains every payment method enabled for your account. The sample below shows only the Card EMI fields, for three banks.

```json Response theme={null}
{
  "entity": "methods",
  "emi": true,
  "emi_options": {
    "HDFC": [
      {
        "duration": 3,
        "interest": 18,
        "subvention": "customer",
        "min_amount": 100000,
        "merchant_payback": "2.61",
        "processing_fee_plan": {
          "type": "fixed",
          "amount": 29900
        }
      },
      {
        "duration": 6,
        "interest": 17,
        "subvention": "customer",
        "min_amount": 100000,
        "merchant_payback": "3.41",
        "processing_fee_plan": {
          "type": "fixed",
          "amount": 29900
        }
      }
    ],
    "ICIC": [
      {
        "duration": 3,
        "interest": 15.99,
        "subvention": "customer",
        "min_amount": 150000,
        "merchant_payback": "0.00",
        "processing_fee_plan": {
          "type": "combination",
          "percentage": 2.99,
          "amount": 29900
        }
      }
    ],
    "SCBL": [
      {
        "duration": 6,
        "interest": 13,
        "subvention": "customer",
        "min_amount": 250000,
        "merchant_payback": "3.68",
        "processing_fee_plan": {
          "type": "percentage",
          "percentage": 1
        }
      }
    ]
  }
}
```

#### Response Parameters

**emi** `boolean`

Indicates whether EMI is enabled on your account. Possible values:

* `true`: EMI is enabled.
* `false`: EMI is not enabled. Do not show the EMI option.

**emi\_options** `object`

Detailed EMI plans, keyed by bank code. Each bank has an array of plans, one per tenure. Each plan contains:

**properties**

**duration** `integer`

Tenure in months. Pass this value as `emi_duration` when you create the payment.

**interest** `number`

Annual interest rate in percent.

**subvention** `string`

Who bears the interest. Possible values:

* `customer`: The customer pays the interest.
* `merchant`: You bear the interest (no-cost or low-cost EMI).

**min\_amount** `integer`

Minimum payment amount for this tenure, in paise.

**merchant\_payback** `string`

Merchant payback percentage for this plan. You do not need it to display customer-paid EMI plans.

**processing\_fee\_plan** `object`

The processing fee the issuing bank charges the customer for this plan. Some banks do not return this object. `type` is one of:

* `percentage`: A percentage of the amount. For example, `{"type": "percentage", "percentage": 1}` is 1% of the amount.
* `fixed`: A fixed amount in paise. For example, `{"type": "fixed", "amount": 29900}` is ₹299.
* `combination`: A percentage and a fixed amount in paise. For example, `{"type": "combination", "percentage": 2.99, "amount": 29900}`.

Keys that end with `_DC` (for example, `HDFC_DC`) are debit card EMI plans. `BAJAJ` is Bajaj Finserv EMI. All other keys are credit card EMI plans.

> [!NOTE]
>
> **Handy Tips**
>
> * Show only the banks and tenures returned in `emi_options`.
> * Show a tenure only when the payment amount is at least that plan's `min_amount`.
> * If the plan has a `processing_fee_plan`, show the fee to the customer before they choose the plan.

#### Supported Banks

Card EMI supports the banks and lenders below. `/v1/methods` returns only the banks enabled for your account, so your list can be shorter. Contact your Razorpay account manager to enable more banks.

##### Credit Card EMI

| Bank | Code |
| - | - |
| American Express | `AMEX` |
| AU Small Finance Bank | `AUBL` |
| Axis Bank | `UTIB` |
| Bank of Baroda | `BARB` |
| Citibank | `CITI` |
| Federal Bank | `FDRL` |
| HDFC Bank | `HDFC` |
| HSBC | `HSBC` |
| ICICI Bank | `ICIC` |
| IDFC FIRST Bank | `IDFB` |
| IndusInd Bank | `INDB` |
| Kotak Mahindra Bank | `KKBK` |
| OneCard | `onecard` |
| RBL Bank | `RATN` |
| Standard Chartered | `SCBL` |
| State Bank of India | `SBIN` |
| Yes Bank | `YESB` |

##### Debit Card EMI

| Bank | Code |
| - | - |
| HDFC Bank | `HDFC_DC` |

Debit Card EMI is available only to customers the bank has pre-approved. You can check this before checkout with the [Eligibility Check API](https://razorpay.com/docs/payments/payment-gateway/emi%C2%B2/eligibility-check).

##### Other EMI

| Lender | Code |
| - | - |
| Bajaj Finserv | `BAJAJ` |

### 1.2 Create an Order

Create an order on your server for every payment. Pass the order `id` in the payment request in the next step.

**Endpoint:** `POST https://api.razorpay.com/v1/orders`

```bash Request theme={null}
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/orders \
-H "content-type: application/json" \
-d '{
  "amount": 600000,
  "currency": "INR",
  "receipt": "receipt#1",
  "notes": {
    "key1": "value3"
  }
}'
```

```json Response theme={null}
{
  "amount": 600000,
  "amount_due": 600000,
  "amount_paid": 0,
  "attempts": 0,
  "created_at": 1794918640,
  "currency": "INR",
  "entity": "order",
  "id": "order_U1F8RW4PEc5O7Y",
  "notes": {
    "key1": "value3"
  },
  "receipt": "receipt#1",
  "status": "created"
}
```

#### Request Parameters

**amount** `integer` *required*

The payment amount in paise. For example, for ₹6,000, enter `600000`. The amount must be at least the `min_amount` of the EMI plan the customer chooses.

**currency** `string` *required*

The currency of the payment. Card EMI supports only `INR`.

**receipt** `string`

Your receipt number for the order. Maximum 40 characters.

**notes** `object`

Key-value pairs for additional information. Maximum 15 pairs, 256 characters each.

### 1.3 Create a Payment

Once you create the order and the customer enters their card details and picks an EMI plan, send the payment request from your server. Set `method` to `emi` and pass the chosen tenure in `emi_duration`.

**Endpoint:** `POST https://api.razorpay.com/v1/payments/create/json`

```bash Request theme={null}
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/payments/create/json \
-H "content-type: application/json" \
-d '{
  "amount": 600000,
  "currency": "INR",
  "order_id": "order_U1F8RW4PEc5O7Y",
  "email": "gaurav.kumar@example.com",
  "contact": "9000090000",
  "method": "emi",
  "emi_duration": 3,
  "card": {
    "number": "4341681234567896",
    "name": "Gaurav Kumar",
    "expiry_month": "12",
    "expiry_year": "30",
    "cvv": "123"
  },
  "authentication": {
    "authentication_channel": "browser"
  },
  "browser": {
    "java_enabled": false,
    "javascript_enabled": false,
    "timezone_offset": -330,
    "color_depth": 24,
    "screen_width": 1920,
    "screen_height": 1080,
    "language": "en-US"
  },
  "ip": "105.106.107.108",
  "referer": "https://example.com/checkout",
  "user_agent": "Mozilla/5.0",
  "callback_url": "https://example.com/callback",
  "notes": {
    "note_key": "value1"
  }
}'
```

```json Response theme={null}
{
  "razorpay_payment_id": "pay_U1F9ZJLJhsjkP0",
  "next": [
    {
      "action": "redirect",
      "url": "https://api.razorpay.com/v1/payments/pay_U1F9ZJLJhsjkP0/authenticate"
    },
    {
      "action": "otp_generate",
      "url": "https://api.razorpay.com/v1/payments/pay_U1F9ZJLJhsjkP0/otp_generate?key_id=[YOUR_KEY_ID]"
    }
  ]
}
```

#### Request Parameters

**amount** `integer` *required*

The payment amount in paise. It must match the order amount and be at least the `min_amount` of the chosen EMI plan.

**currency** `string` *required*

The currency of the payment. Possible value: `INR`.

**order\_id** `string` *required*

The order id returned in [step 1.2](#12-create-an-order).

**email** `string` *required*

The customer's email address.

**contact** `string` *required*

The customer's phone number.

**method** `string` *required*

The payment method. Possible value: `emi`.

**emi\_duration** `integer` *required*

The EMI tenure in months. Use a `duration` returned in `emi_options` for the bank that issued the card.

**card** `object` *required*

The card details.

**properties**

**number** `string` *required*

The card number.

**name** `string`

The cardholder's name.

**expiry\_month** `string` *required*

The card's expiry month, for example `12`.

**expiry\_year** `string` *required*

The card's expiry year, for example `30`.

**cvv** `string` *required*

The card's CVV.

**authentication** `object`

Details of the authentication channel.

**properties**

**authentication\_channel** `string`

The channel the customer authenticates on. Possible values:

* `browser` (default)
* `app`

**browser** `object` *required*

Details of the customer's browser. Not needed when `authentication_channel` is `app`.

**properties**

**java\_enabled** `boolean`

Whether Java is enabled in the browser.

**javascript\_enabled** `boolean`

Whether JavaScript is enabled in the browser.

**timezone\_offset** `integer`

Time zone offset of the browser from UTC, in minutes.

**color\_depth** `integer`

Colour depth of the screen, in bits per pixel.

**screen\_width** `integer`

Screen width, in pixels.

**screen\_height** `integer`

Screen height, in pixels.

**language** `string`

Browser language, for example `en-US`. Maximum 8 characters.

**ip** `string` *required*

The customer's IP address.

**referer** `string`

The referer header of the customer's browser request.

**user\_agent** `string`

The user agent of the customer's browser.

**callback\_url** `string`

The URL on your website where Razorpay sends the customer after the payment, with a POST request that contains the payment result. Pass this URL to receive the success and failure callbacks in step 1.4.

**notes** `object`

Key-value pairs for additional information. Maximum 15 pairs, 256 characters each.

#### Response Parameters

**razorpay\_payment\_id** `string`

The unique id of the payment.

**next** `array`

The actions you can take to complete the payment.

**properties**

**action** `string`

The action type. Possible values:

* `redirect`: Redirect the customer to `url` to authenticate the payment with their bank.
* `otp_generate`: Generates an OTP for the native OTP flow. You do not need this action for the redirect flow described on this page.

**url** `string`

The URL for the action.

### 1.4 Handle Payment Success and Error Events

Redirect the customer to the `url` of the `redirect` action in the `next` array. The customer authenticates the payment on their bank's page. Razorpay then sends the customer to your `callback_url` with a POST request that contains the payment result.

#### Success Callback

If the payment succeeds, the callback contains these fields:

**razorpay\_payment\_id** `string`

The unique id of the payment.

**razorpay\_order\_id** `string`

The order id the payment belongs to.

**razorpay\_signature** `string`

The signature you verify in [step 1.6](#16-verify-payment-signature).

```json Callback Example theme={null}
{
  "razorpay_payment_id": "pay_U1F9ZJLJhsjkP0",
  "razorpay_order_id": "order_U1F8RW4PEc5O7Y",
  "razorpay_signature": "d74a6118fcfc1a27a6790a3829985503a2baf988f798cd8589af513b31138981"
}
```

#### Failure Callback

If the payment fails, the callback contains an `error` object. The callback is a form-encoded POST; the example below shows its fields as JSON. Show the customer a failure message and let them retry.

```json Callback Example theme={null}
{
  "error": {
    "code": "GATEWAY_ERROR",
    "description": "Payment processing failed due to error at bank or wallet gateway",
    "source": "gateway",
    "step": "payment_authorization",
    "reason": "gateway_technical_error",
    "metadata": {
      "payment_id": "pay_U1FAidbl7KxIyP"
    }
  }
}
```

The payment request can also fail before the customer is redirected. These are common Card EMI errors:

| Error description | Cause | What to do |
| - | - | - |
| `Emi is not available for the card used in the transaction` | The card does not support EMI. | Ask the customer to use a different card or payment method. |
| `EMI plan does not exist.` | No EMI plan exists for the card's bank and the `emi_duration` you sent. | Send a `duration` returned in `emi_options` for that bank. |
| `Emi duration is not valid` | The request does not contain a valid `emi_duration`. | Pass `emi_duration` with the tenure the customer chose. |

These errors return HTTP status `400` with error code `BAD_REQUEST_ERROR`. For example:

```json Response theme={null}
{
  "error": {
    "code": "BAD_REQUEST_ERROR",
    "description": "Emi is not available for the card used in the transaction",
    "source": "business"
  }
}
```

Know more about [errors](https://razorpay.com/docs/errors/).

### 1.5 Fetch Payment Details and Status

Fetch the payment with the `razorpay_payment_id` from the callback to check its status and EMI plan.

**Endpoint:** `GET https://api.razorpay.com/v1/payments/:id`

```bash Request theme={null}
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X GET https://api.razorpay.com/v1/payments/pay_U1F9ZJLJhsjkP0
```

```json Response theme={null}
{
  "id": "pay_U1F9ZJLJhsjkP0",
  "entity": "payment",
  "amount": 600000,
  "currency": "INR",
  "status": "authorized",
  "invoice_id": null,
  "international": false,
  "method": "emi",
  "amount_refunded": 0,
  "refund_status": null,
  "captured": false,
  "description": null,
  "card_id": "card_U1F9ZJLJhsjkP0",
  "card": {
    "id": "card_U1F9ZJLJhsjkP0",
    "entity": "card",
    "name": "",
    "last4": "7896",
    "network": "Visa",
    "type": "credit",
    "issuer": "HDFC",
    "international": false,
    "sub_type": "consumer"
  },
  "bank": "HDFC",
  "wallet": null,
  "vpa": null,
  "email": "gaurav.kumar@example.com",
  "contact": "+919000090000",
  "notes": {
    "note_key": "value1"
  },
  "fee": 0,
  "tax": 0,
  "error_code": null,
  "error_description": null,
  "error_source": null,
  "error_step": null,
  "error_reason": null,
  "acquirer_data": {
    "auth_code": null
  },
  "emi_plan": {
    "issuer": "HDFC",
    "type": "credit",
    "rate": 1600,
    "duration": 3
  },
  "created_at": 1794918704
}
```

To get the EMI details in an `emi` object, add `expand[]=emi` to the request.

```bash Request theme={null}
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X GET "https://api.razorpay.com/v1/payments/pay_U1F9ZJLJhsjkP0?expand[]=emi"
```

```json Response (trimmed) theme={null}
{
  "id": "pay_U1F9ZJLJhsjkP0",
  "entity": "payment",
  "amount": 600000,
  "currency": "INR",
  "status": "authorized",
  "method": "emi",
  "bank": "HDFC",
  "emi": {
    "issuer": "HDFC",
    "type": "credit",
    "rate": 1600,
    "duration": 3
  }
}
```

#### EMI Response Parameters

Without `expand[]=emi`, the same fields are returned in the `emi_plan` object.

**issuer** `string`

The bank code of the card issuer. For example, `HDFC`.

**type** `string`

The card type. Possible values: `credit`, `debit`.

**rate** `integer`

The annual interest rate in basis points. For example, `1600` is 16%.

**duration** `integer`

The EMI tenure in months.

### 1.6 Verify Payment Signature

Signature verification is mandatory. Verify the `razorpay_signature` from the success callback on your server. This confirms the callback came from Razorpay. Use the `order_id` stored on your server, not the `razorpay_order_id` from the callback.

1. Create a string by joining the `order_id` from your server and the `razorpay_payment_id` from the callback with a `|`.
2. Generate an HMAC-SHA256 hex digest of the string, using your key secret as the key.
3. Compare the result with `razorpay_signature`. If they match, the payment is authentic.

```js Pseudocode theme={null}
generated_signature = hmac_sha256(order_id + "|" + razorpay_payment_id, secret);

if (generated_signature == razorpay_signature) {
  payment is successful
}
```

### 1.7 Integrate Payments Rainy Day Kit

Use the Payments Rainy Day kit to handle these situations:

* [Late Authorisation](https://razorpay.com/docs/payments/payments/late-authorisation.md)
* [Payment Downtime](https://razorpay.com/docs/api/payments/downtime.md)
* [Payment Errors](https://razorpay.com/docs/errors/), including the Card EMI errors in [step 1.4](#14-handle-payment-success-and-error-events).

### 1.8 Verify Payment Status

> [!NOTE]
>
> **Handy Tips**
>
> Check that the payment `status` is `captured` before you deliver the product or service. An `authorized` payment is not yet captured. You can [capture payments automatically](https://razorpay.com/docs/payments/payments/capture-settings.md).

You can check the payment status in one of these ways:

* **Dashboard**: Check the payment status in the Transactions section of the Razorpay Dashboard.
* **Webhooks**: Subscribe to webhook events such as `payment.authorized`, `payment.captured`, `order.paid` and `payment.failed`. Know how to [set up webhooks](https://razorpay.com/docs/webhooks/setup-edit-payments.md).
* **APIs**: [Poll the Payment APIs](https://razorpay.com/docs/api/payments/fetch-all-payments.md) to check the payment status.

## Next Steps

[Step 2: Test Integration](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/json/v2/test-integration)
