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 & Settings → Website and app settings → API 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.Step 1: Integrate the Widget
Follow the integration steps given below to integrate the widget:- Embed the JavaScript file into your website. Copy the snippet and add it to the head section of your website.
JavaScript
- Create an HTML element with the below id under the product price. This is to indicate where the affordability widget should appear.
Add Parameter
- 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.
You can now preview the widget on your product description page in test mode. Here is a glimpse of the default widget.
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.- Log in to the Dashboard and navigate to Affordability in the Payment Products section.
- Choose Others as your website platform.
- Click Enable Widget in the Go live! section.
- 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.
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
- Fill in the integration support form in case you are facing any issues with the integration.
- In case you have any queries, raise a ticket on the Razorpay Support Portal.