ChargebeeAPI

Plans

Specifies the price with billing frequency for a subscription. Create separate plans for varied price or billing frequency. For example, if you need to charge $10 per month for a group of customers and $100 per year for another group of customers, then create separate plans for each.

Sample PlanJSON

Plans attributes

id
required, string, max chars=100

A unique ID for your system to identify the plan.

name
required, string, max chars=100

The display name used in web interface for identifying the plan.

invoice_name
optional, string, max chars=100

Display name used in invoice. If it is not configured then name is used in invoice.

price
optional, in cents, min=0

The price of the plan. The unit depends on the type of currency .

currency_code
required, string, max chars=3

The currency code (ISO 4217 format) of the plan

period
required, integer, default=1, min=1

Defines billing frequency. Example: to bill customer every 3 months, provide "3" here.

period_unit
required, enumerated string, default=month

Defines billing frequency in association with billing period.

Possible Enum Values
day

Charge based on day(s)

week

Charge based on week(s)

month

Charge based on month(s)

year

Charge based on year(s)

trial_period
optional, integer, min=1

The free time window for your customer to try your product

trial_period_unit
optional, enumerated string

Time unit for the trial period.

Possible Enum Values
day

In days

month

In months

trial_end_action
optional, enumerated string

Applicable only when End-of-trial Action has been enabled for the site. Whenever the plan has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends. This can be overridden at the subscription-level .

Possible Enum Values
site_default

The action configured for the site at the time when the trial ends, takes effect.

activate_subscription

The subscription activates and charges are raised for non-metered items.

cancel_subscription

The subscription cancels.

pricing_model
required, enumerated string, default=flat_fee

Defines how the recurring charges for the subscription is calculated.

Possible Enum Values
flat_fee

A fixed price that is not quantity-based.

per_unit

A fixed price per unit quantity.

tiered

There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.

volume

The per unit price is based on the tier that the total quantity falls in.

stairstep

A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.

free_quantity
required, integer, default=0, min=0

Free quantity the subscriptions of this plan will have. Only the quantity more than this will be charged for the subscription.

setup_cost
optional, in cents, min=1

One-time setup fee charged as part of the first invoice.

status
required, enumerated string, default=active

The plan state

Possible Enum Values
active

New subscriptions can be created with the plan.

archived

No new subscriptions allowed for the plan. Existing subscriptions on this plan will remain as-is and can be migrated to another active plan if required.

deleted

Indicates the plan has been deleted.

archived_at
optional, timestamp(UTC) in seconds

Time at which the plan was moved to archived status.

billing_cycles
optional, integer, min=1

The number of billing cycles the subscription is active. The subscription is moved to non renewing state and then to cancelled state automatically

redirect_url
optional, string, max chars=500

The url to redirect on successful checkout. Eg: https://yoursite.com/success.html?plan=basic

enabled_in_hosted_pages
required, boolean, default=true

If true, allow checkout through plan specific hosted page URL for this plan.

enabled_in_portal
required, boolean, default=true

If enabled, customers can switch to this plan using the 'Change Subscription' option in the customer portal.

addon_applicability
required, enumerated string, default=all

Indicates if all or only some addons are applicable with the plan.

Possible Enum Values
all

All addons are applicable with this plan.

restricted

Only addons marked as 'applicable_addons' are applicable with the plan.

tax_code
optional, string, max chars=50

The Avalara tax codes to which items are mapped to should be provided here. Applicable only if you use Chargebee's AvaTax for Sales integration .

hsn_code
optional, string, max chars=50

The HSN code to which the item is mapped for calculating the customer's tax in India. Applicable only when both of the following conditions are true:

taxjar_product_code
optional, string, max chars=50

The TaxJar product codes to which items are mapped to should be provided here. Applicable only if you use Chargebee's TaxJar integration .

avalara_sale_type
optional, enumerated string

Indicates the type of sale carried out. This is applicable only if you use Chargebee's AvaTax for Communications integration.

Possible Enum Values
wholesale

Transaction is a sale to another company that will resell your product or service to another consumer

retail

Transaction is a sale to an end user

consumed

Transaction is for an item that is consumed directly

vendor_use

Transaction is for an item that is subject to vendor use tax

avalara_transaction_type
optional, integer

Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use Chargebee's AvaTax for Communications integration.

avalara_service_type
optional, integer

Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use Chargebee's AvaTax for Communications integration.

sku
optional, string, max chars=100

The field is used as Product name/code in your third party accounting application. Chargebee will use it as an alternate name in your accounting application.

accounting_code
optional, string, max chars=100

This field is to capture the Account code setup in your Accounting system for integration purposes only.

accounting_category1
optional, string, max chars=100

Used exclusively with the following accounting integrations

  • Xero: If you've categorized your products in Xero, provide the category name and option. Use the format: : . For example:Location: Singapore.
  • QuickBooks: If you've categorized your product sales in QuickBooks according to Classes, provide the class name here. Use the following format: ::...
  • NetSuite: If you've categorized your products in NetSuite under Classes, provide the class name here. Use the following format: : : .... For example: Services : Plan.
  • Intacct: If you've classified your products in Intacct under Locations, provide the name of the Location here.
accounting_category2
optional, string, max chars=100

Used exclusively with the following accounting integrations

  • Xero: If you've categorized your products in Xero, then provide the second category name and option here. Use the format: : .... For example, Region: South
  • QuickBooks: If you've categorized your product sales in QuickBooks according to Location, provide the Location name here. Use the following format: ::.... For example: Location: North America: Canada
  • NetSuite: If you've categorized your products in NetSuite under Locations, provide the location name here. Use the following format : : .... For example: NA:US:CA
  • Intacct: If you've classified your products in Intacct under Dimensions, provide the value of the Dimension here.
accounting_category3
optional, string, max chars=100

Used exclusively with the following accounting integrations

  • NetSuite: If you've categorized your products in NetSuite under Departments, pass the department name here. Use the following format: : : .... For example: Production: Assembly.
  • Intacct: If you've classified your products in Intacct under multiple Dimensions, provide the value of the second Dimension here.
accounting_category4
optional, string, max chars=100

Used exclusively with the following accounting integrations

  • NetSuite: Provide the "Revenue Recognition Rule Id" for the product from NetSuite.
  • Intacct: If you have configured "Revenue Recognition Templates" for products in Intacct, provide the template ID for the product.
is_shippable
optional, boolean, default=false

If enabled, charges for this plan/addon will be added to orders.

shipping_frequency_period
optional, integer, min=1

Defines the shipping frequency. Example: to bill customer every 2 weeks, provide "2" here.

shipping_frequency_period_unit
optional, enumerated string

Defines the shipping frequency in association with shipping period.

Possible Enum Values
year

Ship based on year(s)

month

Ship based on month(s)

week

Ship based on week(s)

day

Ship based on day(s)

resource_version
optional, long

Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

updated_at
optional, timestamp(UTC) in seconds

Timestamp indicating when this plan was last updated. This attribute will be present only if the resource has been updated after 2016-11-09.

giftable
required, boolean, default=false

Specifies if the plan should be gifted or not.

claim_url
optional, string, max chars=500

The url to redirect on successful claim. Eg: https://yoursite.com/claim_success.html?plan=basic

free_quantity_in_decimal
optional, string, max chars=33

The quantity of the plan that is available free-of-charge, represented in decimal. When a subscription is created for this plan or when the plan of a subscription is changed to this one, only the quantity above this number is charged for. Applicable for quantity-based plans and only when multi-decimal pricing is enabled.

price_in_decimal
optional, string, max chars=39

The price of the plan when the pricing_model is flat_fee. When the pricing model is per_unit , it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when multi-decimal pricing is enabled.

channel
optional, enumerated string

The subscription channel this object originated from and is maintained in.

Possible Enum Values
web

The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.

app_store

The object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.

play_store

The object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.

invoice_notes
optional, string, max chars=2000

A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes displayed on the invoice PDF.

taxable
optional, boolean, default=true

Specifies whether taxes apply to this plan. This value is set and returned even if Taxes have been disabled in Chargebee. However, the value is effective only while Taxes are enabled.

tax_profile_id
optional, string, max chars=50

Tax profile of the plan.

meta_data
optional, jsonobject

A collection of key-value pairs that provides extra information about the plan.

Note: There's a character limit of 65,535.

Learn more .

show_description_in_invoices
optional, boolean, default=false

Whether the plan.description should be shown on invoice PDFs. If this Boolean is changed, only invoices generated (or regenerated )after the change are affected; past invoices are not.

show_description_in_quotes
optional, boolean, default=false

Whether the plan description should be shown on quote PDFs. If this Boolean is changed, only quotes created after the change are affected; past quotes are not.

tiers
optional, list of tier

List of tiers for this plan(applicable only if it is tiered/volume/stairtstep pricing)

tax_providers_fields
optional, list of tax_providers_field

List of vendor specific tax related information.

applicable_addons
optional, list of applicable_addon

List of addons applicable with this plan.

attached_addons
optional, list of attached_addon

Indicates if the addon is attached with the plan as mandatory or recommended.

event_based_addons
optional, list of event_based_addon

List of addons that will be charged on occurrence of specific event on subscribing to the plan.