Skip to main content
POST
Use this endpoint to create a plan.

Request Parameters

string
required
This, combined with interval, defines the frequency of the plan. Possible values:
  • daily
  • weekly
  • monthly
  • quarterly
  • yearly
Handy TipsYou can create custom frequencies while creating a plan. For example, once in 3 weeks.
  • For UPI, all undefined frequencies except daily, weekly, monthly, quarterly and yearly are considered as-presented.
  • For domestic cards, all undefined frequencies except weekly, monthly and yearly are considered as-presented while registering the mandate with banks.
  • For Emandate, all defined and undefined frequencies are considered as-presented while registering the mandate with banks.
integer
required
This, combined with period, defines the frequency of the plan. If the billing cycle is 2 months, the value should be 2. For daily plans, the minimum value should be 7.
object
Details of the plan.
string
required
Name of the plan. For example, Test Plan.
integer
required
Amount for the plan that is to be charged to the subscription in the next billing cycle. For example, 69900 translates to ₹699.
string
required
Currency for the payment. For example, INR. You can accept payment in any of the supported currencies.
string
Description for the plan. For example, Description for the test plan.
object
Notes you can enter of the contact for future reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs. For example, "note_key": "Monthly gym membership".

Response Parameters

string
The unique identifier linked to a plan. For example, plan_00000000000001. This ID is used when creating a subscription for a customer.
string
The entity being created. Here, it is plan.
integer
Used together with period to define how often the customer should be charged.
string
Used together with interval to define how often the customer should be charged. Possible values:
  • daily
  • weekly
  • monthly
  • yearly
array
Details of the plan.
string
The unique identifier linked to an item. For example, item_00000000000001.
string
Name of the plan. For example, Test Plan.
integer
Amount for the plan. When you use this plan to create a subscription, the customer will be charged this amount periodically.
string
Currency for the payment. You can accept payment in any of the supported currencies.
string
Description for the plan. For example, Description for the test plan.
object
Notes you can enter of the contact for future reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs. For example, "note_key": "Monthly Gym".
integer
The Unix timestamp at which the plan was created.

Errors

Code: 401This error occurs when you use incorrect or invalid API Keys.Solution: Use the right set of API keys.
Code: 400This error occurs when you are passing offer_id parameter in the request body.Solution: offer_id should not be passed in the request body.
Code: 400The amount specified is less than the minimum amount. Currency subunits, such as paise (in the case of INR), should always be greater than 100.Solution: Enter an amount equal to or greater than the minimum amount, that is 100.
Code: 400The period field was not included in the request body.Solution: Pass period as one of the supported values (for example daily, weekly, monthly, yearly).
Code: 400The value passed for period is not one of the supported values.Solution: Use one of the supported period values: daily, weekly, monthly, yearly.
Code: 400The interval field was not included in the request body.Solution: Pass interval as a positive integer specifying how many period units between each billing cycle.
Code: 400The interval value is 0 or negative.Solution: Pass interval as an integer greater than or equal to 1.
Code: 400A non-integer value was passed for interval.Solution: Pass interval as an integer.
Code: 400Neither the item object nor an item_id was included in the request body.Solution: Pass either an inline item object (with name, amount, currency) or an existing item_id.
Code: 400The item.name field was not included in the inline item object.Solution: Always include item.name when passing an inline item.
Code: 400Neither item.amount nor item.unit_amount was included in the request body.Solution: Pass item.amount (in currency subunits) or item.unit_amount.
Code: 400A negative or out-of-range value was passed for item.amount.Solution: Pass item.amount as a non-negative integer below 4294967295.
Code: 400The item.currency value is not one of the supported ISO currency codes.Solution: Use a supported 3-letter ISO currency code (for example, INR).
Code: 400The request body contains fields that are not part of the Plans API schema.Solution: Only include documented fields in the request body.