Skip to main content
Available in🇮🇳 India
Integrate with Affordability Widget to influence your customer’s purchase decisions before they reach checkout by displaying various affordable payment options and offers.
Handy TipsRazorpay Affordability Widget is compatible with all JavaScript frameworks like React, Vue, Angular, Svelte and so on.

Prerequisites

  • Create a Razorpay account.
  • Generate the API keys from the Dashboard by navigating to Account & SettingsWebsite and app settingsAPI keys.
  • You can use the Test Mode keys to test the integration and preview the Widget. Later, switch to Live Mode of the Dashboard, generate the Live API keys and replace it with the test keys.
Handy TipsOnly the Owner, Admin and Manager roles can enable the widget.

Integration Steps

Follow the integration steps given below to embed the widget on your website.
  1. Integrate the Widget.
  2. Enable the Widget.

Step 1: Integrate the Widget

Follow the integration steps given below to integrate the widget:
  1. Embed the JavaScript file into your website. Copy the snippet and add it to the head section of your website.
JavaScript
  1. Create an HTML element with the below id under the product price. This is to indicate where the affordability widget should appear.
Add Parameter
  1. Copy-paste the following snippet to the JS file and link it to your HTML file. Add the test key ID generated from the Dashboard.
Add Parameter
key mandatory : string API Key ID generated from the Dashboard. For example, rzp_test_XXXX00000XXXX. amount mandatory : integer The amount to be paid by the customer in paise. For example, if the amount is ₹4000, enter 400000.
Watch Out!Ensure you pass the final amount in paise to the widget which you want to display to your customers on the product and checkout pages.
You can now preview the widget on your product description page in test mode. Here is a glimpse of the default widget. Preview the widget in test mode

Switch to Live Mode

After you preview the widget, switch to live mode and replace the test API keys in the sample code with the live ones to take the integration live. Know more about live API keys.

Step 2: Enable the Widget

Once you preview the widget on your product description page, you have to enable the widget to display it on your website for your customers.
  1. Log in to the Dashboard and navigate to Affordability in the Payment Products section.
  2. Choose Others as your website platform. Select website platform for widget
  3. Click Enable Widget in the Go live! section. Enable the widget
  4. Select the check box if you consent to enable the widget and click Yes, enable.

Successful Activation

Here is a glimpse of the default widget with offers and payment method options enabled. Glimpse of the default widget
Minimum Order LimitAll the payment method options that are enabled and that satisfy the minimum order limit appear on the widget. Know more about the minimum order limit for:
Feature EnablementRaise a request with our Support team to integrate Razorpay Affordability Widget with Checkout. Your customers can select an offer/payment option on the widget, proceed to checkout and complete the payment.

Next Steps

After you successfully integrate the widget on your website, you can choose to customise the widget based on your requirement.
Handy Tips