You can create plans on-the-fly via the API and also fetch them as required. The plan entity has the following attributes:
- Plan ID which will be used to create subscriptions for the customers.
- Mandatory. Name of the plan.
- Optional. Description of the plan.
- Mandatory. Amount of the plan, that will be charged to all the customers subscribed to this plan, on a recurring basis.
- Mandatory. Currently, only
- Mandatory. This, combined with
period, defines the frequency. If the billing cycle is of 2 months, the value for this attribute would be
2. For daily plans, the minimum interval is 7.
- Mandatory. This, combined with
interval, defines the frequency. If the billing cycle is of 2 months, the value for this attribute would be
monthly. The values supported for this attribute currently are:
- Optional. Object consisting of key value pairs as notes. Refer here for more details.
Subscriptions allow you to charge a customer's card on a recurring basis. A subscription ties a customer to a particular plan you've created. The following are the attributes of a subscription entity:
- Subscription ID
- Mandatory. ID of the plan to which the customer is subscribing to.
- ID of the customer who is subscribing to a plan. This will be populated automatically once the customer completes the first transaction via our checkout.
- Mandatory. The number of billing cycles that the customer needs to be charged for. If the customer is buying a 1 year subscription, billed bi-monthly, this value should be 6.
- Mandatory. This indicates whether the communication to the customer would be handled by you or by us. If it's set to 0, the communication to the customer would be handled by the merchant. If it's set to 1, we would take care of communicating any failures or charges to the customer.
- Optional. This would be the start of the first billing cycle. If the start_at is not passed, the billing cycle for the customer starts immediately during the auth transaction. Otherwise, the billing cycle would start at the specified time.
- Optional. The quantity of the plan to which the customer should be subscribed. For example, if the plan is Rs100/user/month, and the customer has 5 users, you should pass 5 as the quantity to have the customer charged Rs500 (5 x Rs100) monthly. By default, this value is set to 1, if nothing is passed.
- Optional. Object consisting of key value pairs as notes. Read more here
addonsArray of objects
- Optional. This can be used to charge the customer a one time fees before the start of the subscription. This can include something like one-time delivery charges or a security deposit. More details about this can be found at upfront section
- Status of the subscription. Possible values:
expired. The explanations for these is provided in the Lifecycle section.
- This indicates the number of billing cycles that the customer has already been charged for.
- This indicates the start time of the current billing cycle of the subscription.
- This indicates the end time of the current billing cycle of the subscription.
- This will have the timestamp of the time when the subscription has completed its period or has been cancelled midway.
- This indicates the time when the next charge on the subscription will be made.
- The number of times that the charge for the current billing cycle has been attempted for, on the card.
You can create add-ons to charge an extra amount for a particular billing cycle. Once you create an add-on, it gets attached to the next invoice that gets generated for the given subscription. Hence, it'll get applied to the next automated charge scheduled for the subscription.
The add-on entity has the following attributes:
- Addon ID
- Mandatory. Name of the add-on.
- Optional. Description of the add-on.
- Mandatory. Amount of the addon, that will be charged to the subscription for the next billing cycle.
- Currently, only
- Optional. This specifies the number of units of the item that you want to charge the customer for. By default, this is
1. The total amount is calculated as
- The ID of the subscription to which the addon is being applied to.
- The ID of the invoice to which the addon has been applied to. This field gets populated only after the invoice is generated. Until then, it'll be
null. The add-on will get added to the next invoice that gets generated after the addon has been created. Once the addon has been consumed by an invoice, it cannot be deleted.