Seamless Subscriptions
In this article, you will learn in detail about Seamless Subscriptions.
Seamless subscription allows you to provide your own payment experience to your customers. These seamless APIs allow businesses to have full control of the checkout experience. With this, you can collect all payment details on your webpage and safely send them to Cashfree Payments for processing the payments.
Seamless Subscription Flow
To build a seamless subscription flow for your customers, follow the steps below:
- Create Plan - The first step is to create a plan. Plans are a prerequisite to create a subscription. Click here to know more about creating plans using APIs.
- Create Seamless Subscription - Once you have created a plan, the next step is to create a subscription. You can charge your customers periodically (periodic) or whenever required (on-demand) for a subscription. Click here to know more about creating subscriptions seamlessly using APIs.
- Create Authorisation Request - Now that you have created a subscription, the next step is to create an authorisation request. This authorisation request is for the subscription you created in the previous step. This is applicable only if you have created the subscription using the Create Seamless Subscription API.
- Get Authorisation Status - You can check the status of an authorisation request using this API. This is applicable only if you have created the subscription using the Create Seamless Subscription API.
To experience the seamless checkout flow in the test environment, we have provided you with two APIs. Details on how to use them are explained in the sections below:
- Update Authorisation Status
- Update Charge Status
The Update Authorisation Status and the Update Charge Status APIs are applicable only in the test environment. Actions that happen in the test environment have no consequences in the production environment.
List of all possible auth statuses are mentioned in the table below:
Auth Status | Description |
---|---|
INITIALIZED | This status indicates that the auth is created. |
PENDING | This status indicates that the auth has been attempted by the user, but the response is pending from the bank. |
ACTIVE | This status indicates that the auth has been attempted by the user, and we have received a success response from the bank. |
FAILED | This status indicates that the auth has failed due to failed response from the bank. |
Update Authorisation Status
The update authorisation status API allows you to update the authorisation status from INITIALIZED state to SUCCESS or FAILED state. To update an authorisation status, there are certain steps you must perform, they are mentioned below:
- Create a plan
- Create a seamless subscription
- Create a authorisation request
- Get the authorisation status
- Update the authorisation status
Click here to know more about updating the authorisation status via API.
Update Charge Status
The update charge status allows you to update the charge status from PENDING state to SUCCESS or FAILED state. You can update a charge status only if you have created a charge.
There are certain steps you must perform before updating the charge status of a particular subscription. The steps are explained below:
- Create a plan
- Create a subscription
- Create authorisation
- Update the authorisation status
- Create a charge
- Update charge status
Click here to know more about updating a charge status via API.
Updated about 1 year ago