Skip to main content
Cashfree’s web checkout offers a secure, pre-built interface for collecting subscription mandate authorisations. It supports cards, UPI AutoPay, and eNACH, so you can start recurring payments without building or hosting your own checkout page.

Prerequisites

Complete these steps before you integrate hosted subscription checkout:
  1. Create a Cashfree merchant account.
  2. Log in to the Merchant Dashboard.
  3. Go to Payment Gateway > Developers > API Keys and generate your test client ID and secret key.

Step 1: Create a plan

Create a subscription plan before you open hosted checkout. Use the Create Plan API to define the plan.

Response

Once the request is successful, you will receive a response as shown below:

Step 2: Create subscription

API Documentation: Create Subscription

Response

Once the request is successful, you will receive a response as shown below:

Step 3: Initiate an auth

Use the subscription_session_id received in the response of create subscription to initiate the subscription auth checkout. Refer to below code module to integrate :-
Try out here: codepen
  1. Take the subscription_session_id and paste it in the codepen link and click on Submit.
  1. You will be redirected to the subscription checkout page.
  1. Choose the payment mode you want to setup the subscription and submit. In case of sandbox you will be asked to simulate the payment.
  1. You will be redirected to the return url post the transaction is completed.

Step 4: Get subscription details

Use this API to check the subscription status and auth details post completion of the payment. API Documentation: Get Subscription

Response

Once the request is successful, you will receive a response as shown below:

Step 5: Raise a charge on subscription

API Documentation: Raise a charge

Response

Once the request is successful, you will receive a response as shown below: