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.
Handy TipsContact 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:- Fetch EMI Plans
- Create an Order
- Create a Payment
- Handle Payment Success and Error Events
- Fetch Payment Details and Status
- Verify Payment Signature
- Integrate Payments Rainy Day Kit
- 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 thekey_id query parameter. Do not send your key secret.
Endpoint: GET https://api.razorpay.com/v1/methods
Request
Response
Response Parameters
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.
Detailed EMI plans, keyed by bank code. Each bank has an array of plans, one per tenure. Each plan contains:
_DC (for example, HDFC_DC) are debit card EMI plans. BAJAJ is Bajaj Finserv EMI. All other keys are credit card EMI plans.
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
Debit Card EMI
Debit Card EMI is available only to customers the bank has pre-approved. You can check this before checkout with the Eligibility Check API.
Other EMI
1.2 Create an Order
Create an order on your server for every payment. Pass the orderid in the payment request in the next step.
Endpoint: POST https://api.razorpay.com/v1/orders
Request
Response
Request Parameters
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.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. Setmethod to emi and pass the chosen tenure in emi_duration.
Endpoint: POST https://api.razorpay.com/v1/payments/create/json
Request
Response
Request Parameters
The payment amount in paise. It must match the order amount and be at least the
min_amount of the chosen EMI plan.The order id returned in step 1.2.
The EMI tenure in months. Use a
duration returned in emi_options for the bank that issued the card.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.
Response Parameters
1.4 Handle Payment Success and Error Events
Redirect the customer to theurl 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:The signature you verify in step 1.6.
Callback Example
Failure Callback
If the payment fails, the callback contains anerror 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.
Callback Example
These errors return HTTP status
400 with error code BAD_REQUEST_ERROR. For example:
Response
1.5 Fetch Payment Details and Status
Fetch the payment with therazorpay_payment_id from the callback to check its status and EMI plan.
Endpoint: GET https://api.razorpay.com/v1/payments/:id
Request
Response
emi object, add expand[]=emi to the request.
Request
Response (trimmed)
EMI Response Parameters
Withoutexpand[]=emi, the same fields are returned in the emi_plan object.
1.6 Verify Payment Signature
Signature verification is mandatory. Verify therazorpay_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.
- Create a string by joining the
order_idfrom your server and therazorpay_payment_idfrom the callback with a|. - Generate an HMAC-SHA256 hex digest of the string, using your key secret as the key.
- Compare the result with
razorpay_signature. If they match, the payment is authentic.
Pseudocode
1.7 Integrate Payments Rainy Day Kit
Use the Payments Rainy Day kit to handle these situations:- Late Authorisation
- Payment Downtime
- Payment Errors, including the Card EMI errors in step 1.4.
1.8 Verify Payment Status
Handy TipsCheck 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.- 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.paidandpayment.failed. Know how to set up webhooks. - APIs: Poll the Payment APIs to check the payment status.