During the process of signing up customers to subscriptions, use the Estimates API to evaluate the details of the purchase before actually signing them up. The details returned by the API include the invoice amounts, next billing date and unbilled charges.
For example, consider that you are creating a new subscription or update an existing one. Use the Estimates API before that to deduce the details such as the amount the customer would be charged, the state the subscription would be in after creation or updation, and so on.
If you have configured the Avalara integration, Chargebee retrieves the tax amount from Avalara for the invoice. This counts against your Avalara API limits.
Sample estimate [ JSON ]
{
"created_at": 1612964957,
"invoice_estimate": {
"amount_due": 1100,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOceaKFNz",
"date": 1612964957,
"line_item_discounts": [],
"line_item_taxes": [
{
"is_non_compliance_tax": false,
"is_partial_tax_applied": false,
"line_item_id": "li___test__8asyKSOceaN3O1",
"object": "line_item_tax",
"tax_amount": 91,
"tax_name": "Tax",
"tax_rate": 10,
"taxable_amount": 909
},
{
"is_non_compliance_tax": false,
"is_partial_tax_applied": false,
"line_item_id": "li___test__8asyKSOceaNSO2",
"object": "line_item_tax",
"tax_amount": 9,
"tax_name": "Tax",
"tax_rate": 10,
"taxable_amount": 91
}
],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOceaKFNz",
"date_from": 1612964957,
"date_to": 1615384157,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOceaN3O1",
"is_taxed": true,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"tax_amount": 91,
"tax_rate": 10,
"unit_amount": 1000
},
{
"amount": 100,
"customer_id": "__test__8asyKSOceaKFNz",
"date_from": 1612964957,
"date_to": 1615384157,
"description": "Day Pass USD Monthly",
"discount_amount": 0,
"entity_id": "day-pass-USD",
"entity_type": "addon_item_price",
"id": "li___test__8asyKSOceaNSO2",
"is_taxed": true,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "flat_fee",
"quantity": 1,
"tax_amount": 9,
"tax_rate": 10,
"unit_amount": 100
}
],
"object": "invoice_estimate",
"price_type": "tax_inclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 1100,
"taxes": [
{
"amount": 100,
"description": "Tax @ 10%",
"name": "Tax",
"object": "tax"
}
],
"total": 1100
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"next_billing_at": 1615384157,
"object": "subscription_estimate",
"status": "active"
}
}
API Index URL GET
https://{site}.chargebee.com/api/v2/estimates
timestamp(UTC) in seconds The time at which this estimate got generated optional, subscription_estimate
Represents the subscription details when the 'estimate' operations are invoked.
Subscription estimate attributes
optional, string, max chars=50 The identifier of the subscription
string, max chars=3 The currency code (ISO 4217 format) of the subscription.
optional, enumerated string The status of the subscription. Possible values are
futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.
pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. Show all values[+]
optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+]
optional, timestamp(UTC) in seconds Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.
optional, timestamp(UTC) in seconds The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions
optional, timestamp(UTC) in seconds The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions optional, shipping_address
Represents the shipping address when the 'estimate' operations are invoked.
Shipping address attributes
optional, string, max chars=150 The first name of the contact.
optional, string, max chars=150 The last name of the contact.
optional, string, max chars=70 The email address.
optional, string, max chars=250 The company name.
optional, string, max chars=50 The phone number.
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 The name of the city.
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 The state/province name.
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
integer, min=0 The index number of the subscription to which the item price is added. Provide a unique number between 0
and 4
(inclusive) for each subscription that is to be created. optional, contract_term
Represents the contract terms when the 'estimate' operations are invoked.
string, max chars=50 Id that uniquely identifies the contract term in the site.
enumerated string Current status of contract Possible values are
activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. Show all values[+]
timestamp(UTC) in seconds The start date of the contract term
timestamp(UTC) in seconds The end date of the contract term
integer, min=0 The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renew Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. Show all values[+]
in cents, default=0, min=0 The sum of the totals of all the invoices raised as part of the contract term. For active
contract terms, this is a predicted value. The value depends on the type of currency. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised
. total_contract_value_before_tax
in cents, default=0, min=0 It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for total_amount_raised_before_tax
is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes. cancellation_cutoff_period
optional, integer The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
timestamp(UTC) in seconds The date when the contract term was created.
string, max chars=50 The Id of the subscription that this contract term is for.
optional, integer, min=0 The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for active
contract terms. optional, list of subscription_estimate
Is a list of estimated subscriptions i.e., an array of subscription_estimate objects. It is generated when 'Create an estimate for purchase' operation is invoked
Subscription estimate attributes
optional, string, max chars=50 The identifier of the subscription
string, max chars=3 The currency code (ISO 4217 format) of the subscription.
optional, enumerated string The status of the subscription. Possible values are
futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.
pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. Show all values[+]
optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThe action configured for the site at the time when the trial ends, takes effect. This is the default value when trial_end_action
is not defined for the plan.plan_defaultThe action configured for the site at the time when the trial ends, takes effect. This is the default value when trial_end_action
is defined for the plan.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThe action configured for the site at the time when the trial ends, takes effect. This is the default value when trial_end_action
is not defined for the plan.plan_defaultThe action configured for the site at the time when the trial ends, takes effect. This is the default value when trial_end_action
is defined for the plan.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+]
optional, timestamp(UTC) in seconds Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.
optional, timestamp(UTC) in seconds The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions
optional, timestamp(UTC) in seconds The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions optional, shipping_address
Represents the shipping address when the 'estimate' operations are invoked.
Shipping address attributes
optional, string, max chars=150 The first name of the contact.
optional, string, max chars=150 The last name of the contact.
optional, string, max chars=70 The email address.
optional, string, max chars=250 The company name.
optional, string, max chars=50 The phone number.
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 The name of the city.
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 The state/province name.
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
integer, min=0 The index number of the subscription to which the item price is added. Provide a unique number between 0
and 4
(inclusive) for each subscription that is to be created. optional, contract_term
Represents the contract terms when the 'estimate' operations are invoked.
string, max chars=50 Id that uniquely identifies the contract term in the site.
enumerated string Current status of contract Possible values are
activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. Show all values[+]
timestamp(UTC) in seconds The start date of the contract term
timestamp(UTC) in seconds The end date of the contract term
integer, min=0 The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renew Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. Show all values[+]
in cents, default=0, min=0 The sum of the totals of all the invoices raised as part of the contract term. For active
contract terms, this is a predicted value. The value depends on the type of currency. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised
. total_contract_value_before_tax
in cents, default=0, min=0 It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for total_amount_raised_before_tax
is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes. cancellation_cutoff_period
optional, integer The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
timestamp(UTC) in seconds The date when the contract term was created.
string, max chars=50 The Id of the subscription that this contract term is for.
optional, integer, min=0 The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for active
contract terms. optional, invoice_estimate
Represents the preview of the invoice generated immediately when the 'estimate' operations are invoked.
Invoice estimate attributes
boolean, default=true Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
enumerated string, default=tax_exclusive The price type of this invoice. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+]
string, max chars=3 The currency code (ISO 4217 format) of the invoice.
in cents, min=0 Invoice sub-total in cents.
optional, in cents, default=0, min=0 Invoice total in cents.
optional, in cents, default=0, min=0 credits applied to this invoice in cents.
optional, in cents, default=0, min=0 Existing outstanding payments if any, applied to this invoice in cents.
optional, in cents, default=0, min=0 Invoice amount due in cents optional, list of line_item The details of the line items in this invoice estimate.
Note
Line items that meet both the following conditions are not returned:
- The line item belongs to an item price whose parent item is
metered
.
- The
line_item.amount
is 0
.
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
. optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item. optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API. optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000. optional, list of line_item_credit
A list of store credits applied to line items.
Line item credit attributes
string, max chars=50 The unique ID of the credit note from which the credit is applied.
double, default=0.0 The credit amount is applied to the line item.
optional, string, max chars=40 The unique ID of the line item to which this credit is applied. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
optional, string, max chars=100 A unique identifier for the customer this invoice belongs to optional, list of line_item_address
The list of addresses used for tax calculation on line items.
Line item address attributes
optional, string, max chars=40 Line item reference
optional, string, max chars=150 First name of the customer
optional, string, max chars=150 Last name of the customer
optional, string, max chars=70 Email of the customer
optional, string, max chars=250 Name of the company
optional, string, max chars=50 Phone number of the customer
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 Name of the city
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 State or Province
optional, string, max chars=50 The billing address of the customer, specified as an ISO 3166 alpha-2 code. Entering an invalid code will return an error.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+] optional, list of invoice_estimate
Is a list of estimated invoices i.e., an array of invoice_estimate objects. It is generated when 'Create an estimate for unbilled charges' operation is invoked
Invoice estimate attributes
boolean, default=true Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
enumerated string, default=tax_exclusive The price type of this invoice. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+]
string, max chars=3 The currency code (ISO 4217 format) of the invoice.
in cents, min=0 Invoice sub-total in cents.
optional, in cents, default=0, min=0 Invoice total in cents.
optional, in cents, default=0, min=0 credits applied to this invoice in cents.
optional, in cents, default=0, min=0 Existing outstanding payments if any, applied to this invoice in cents.
optional, in cents, default=0, min=0 Invoice amount due in cents optional, list of line_item The details of the line items in this invoice estimate.
Note
Line items that meet both the following conditions are not returned:
- The line item belongs to an item price whose parent item is
metered
.
- The
line_item.amount
is 0
.
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
. optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item. optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API. optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000. optional, list of line_item_credit
A list of store credits applied to line items.
Line item credit attributes
string, max chars=50 The unique ID of the credit note from which the credit is applied.
double, default=0.0 The credit amount is applied to the line item.
optional, string, max chars=40 The unique ID of the line item to which this credit is applied. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
optional, string, max chars=100 A unique identifier for the customer this invoice belongs to optional, list of line_item_address
The list of addresses used for tax calculation on line items.
Line item address attributes
optional, string, max chars=40 Line item reference
optional, string, max chars=150 First name of the customer
optional, string, max chars=150 Last name of the customer
optional, string, max chars=70 Email of the customer
optional, string, max chars=250 Name of the company
optional, string, max chars=50 Phone number of the customer
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 Name of the city
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 State or Province
optional, string, max chars=50 The billing address of the customer, specified as an ISO 3166 alpha-2 code. Entering an invalid code will return an error.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+] optional, list of payment_schedule_estimate
payment_schedule_estimate
is used to hold the details related to payment schedules for an invoice. It will contain a list of payment_schedules
resources.
Payment schedule estimate attributes
string, max chars=40 An auto-generated unique identifier for the payment schedule.
string, max chars=40 The identifier of the payment_schedule_scheme
, used to create the payment schedules.
enumerated string Specifies the modeled entity that the payment schedule is based on. Possible values are
invoiceRepresents an invoice.
optional, string, max chars=50 The identifier of the modeled entity that this payment schedule is based on.
in cents, min=0 An amount that this payment schedule is able to collect.
optional, string, max chars=3 The currency code (ISO 4217 format) of the transaction amount. optional, list of schedule_entry
List of schedule entries
Schedule entry attributes
string, max chars=40 An auto-generated unique identifier for the payment schedule.
timestamp(UTC) in seconds The date when this payment schedule is scheduled.
in cents, min=0 The total maximum amount that this payment schedule is allowed to collect.
enumerated string Defines the status of each payment schedule. Possible values are
postedIndicates that the payment is posted.payment_dueIndicates that the payment is due.paidIndicates that the payment has been made.
postedIndicates that the payment is posted.payment_dueIndicates that the payment is due.paidIndicates that the payment has been made.
Show all values[+] optional, invoice_estimate
Represents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
Next invoice estimate attributes
boolean, default=true Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
enumerated string, default=tax_exclusive The price type of this invoice. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+]
string, max chars=3 The currency code (ISO 4217 format) of the invoice.
in cents, min=0 Invoice sub-total in cents.
optional, in cents, default=0, min=0 Invoice total in cents.
optional, in cents, default=0, min=0 credits applied to this invoice in cents.
optional, in cents, default=0, min=0 Existing outstanding payments if any, applied to this invoice in cents.
optional, in cents, default=0, min=0 Invoice amount due in cents optional, list of line_item The details of the line items in this invoice estimate.
Note
Line items that meet both the following conditions are not returned:
- The line item belongs to an item price whose parent item is
metered
.
- The
line_item.amount
is 0
.
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
. optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item. optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API. optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000. optional, list of line_item_credit
A list of store credits applied to line items.
Line item credit attributes
string, max chars=50 The unique ID of the credit note from which this credit is applied.
double, default=0.0 The credit amount is applied to the line item.
optional, string, max chars=40 The unique ID of the line item to which this credit is applied. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
optional, string, max chars=100 A unique identifier for the customer this invoice belongs to optional, list of line_item_address
The list of addresses used for tax calculation on line items.
Line item address attributes
optional, string, max chars=40 Line item reference
optional, string, max chars=150 First name of the customer
optional, string, max chars=150 Last name of the customer
optional, string, max chars=70 Email of the customer
optional, string, max chars=250 Name of the company
optional, string, max chars=50 Phone number of the customer
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 Name of the city
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 State or Province
optional, string, max chars=50 The billing address of the customer, specified as an ISO 3166 alpha-2 code. Entering an invalid code will return an error.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+] optional, list of credit_note_estimate
Represents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.
Credit note estimate attributes
string, max chars=50 The reference invoice id
enumerated string Credit note types. Learn more about credit note types. Possible values are
adjustmentAdjustment Credit NoterefundableRefundable Credit NotestoreStore Credit Note
adjustmentAdjustment Credit NoterefundableRefundable Credit NotestoreStore Credit Note
Show all values[+]
enumerated string, default=tax_exclusive The price type of this credit note. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+]
string, max chars=3 The currency code (ISO 4217 format) of the credit note.
in cents, min=0 Invoice sub-total in cents.
in cents, min=0 Credit note total in cents.
in cents, min=0 Allocated credits in cents.
in cents, min=0 Remaining credits in cents optional, list of line_item
The list of items in this estimate
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
. optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item. optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency. optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
optional, string, max chars=100 A unique identifier for the customer this credit note belongs to optional, list of unbilled_charge
Represents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the ‘Subscription renewal estimate’ operation.
Unbilled charge estimate attributes
optional, string, max chars=40 Uniquely identifies an unbilled charge.
optional, string, max chars=50 A unique identifier for the customer being charged.
optional, string, max chars=50 A unique identifier for the subscription this charge belongs to.
optional, timestamp(UTC) in seconds Start date of this charge.
optional, timestamp(UTC) in seconds End date of this charge.
optional, in cents, min=0 Unit amount of the charge item.
optional, enumerated string The pricing scheme for this line item. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
optional, integer, min=0 Quantity of the item which is represented by this charge.
optional, in cents, min=0 Total amount of this charge. Typically equals to unit amount x quantity.
string, max chars=3 The currency code (ISO 4217 format) for the charge.
optional, in cents, min=0 Total discounts for this charge.
optional, string, max chars=250 Detailed description about this charge.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.
boolean, default=false Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.
optional, timestamp(UTC) in seconds Timestamp indicating the date and time this charge got voided.
optional, string, max chars=39 The decimal representation of the amount for the charge, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
timestamp(UTC) in seconds Timestamp indicating when the unbilled charge was last updated optional, list of line_item_tier
The list of tiers applicable for this line item
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
optional, boolean, default=false The value of this parameter will be true if it is a recurring unbilled charge for a future term.
optional, string, max chars=50 The unique ID of the
business entity of this subscription. This is always the same as the
business entity of the customer.
boolean Indicates that this resource has been deleted.
timestamp(UTC) in seconds The time at which this estimate got generated
optional, subscription_estimate Represents the subscription details when the 'estimate' operations are invoked.
optional, list of subscription_estimate Is a list of estimated subscriptions i.e., an array of subscription_estimate objects. It is generated when 'Create an estimate for purchase' operation is invoked
optional, invoice_estimate Represents the preview of the invoice generated immediately when the 'estimate' operations are invoked.
optional, list of invoice_estimate Is a list of estimated invoices i.e., an array of invoice_estimate objects. It is generated when 'Create an estimate for unbilled charges' operation is invoked
optional, list of payment_schedule_estimate payment_schedule_estimate
is used to hold the details related to payment schedules for an invoice. It will contain a list of payment_schedules
resources.
optional, invoice_estimate Represents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
optional, list of credit_note_estimate Represents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.
optional, list of unbilled_charge Represents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the ‘Subscription renewal estimate’ operation.
optional, string, max chars=50 The identifier of the subscription optional, string, max chars=50
The identifier of the subscription
string, max chars=3 The currency code (ISO 4217 format) of the subscription. required, string, max chars=3
The currency code (ISO 4217 format) of the subscription.
optional, enumerated string The status of the subscription. Possible values are
futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. futureThe subscription is scheduled to start at a future date.in_trialThe subscription is in trial.activeThe subscription is active and will be charged for automatically based on the items in it.non_renewingThe subscription will be canceled at the end of the current term.
pausedThe subscription is paused. The subscription will not renew while in this state.cancelledThe subscription has been canceled and is no longer in service.transferredThe subscription has been transferred to another business entity within the organization. Show all values[+] optional, enumerated string
The status of the subscription.
optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+] optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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.
Trial end action attributes
optional, timestamp(UTC) in seconds Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions. optional, timestamp(UTC) in seconds
Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.
Next billing at attributes
optional, timestamp(UTC) in seconds The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions optional, timestamp(UTC) in seconds
The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions
optional, timestamp(UTC) in seconds The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions optional, timestamp(UTC) in seconds
The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions
optional, shipping_address Represents the shipping address when the 'estimate' operations are invoked. optional, shipping_address
Represents the shipping address when the 'estimate' operations are invoked.
Shipping address attributes
optional, string, max chars=150 The first name of the contact.
optional, string, max chars=150 The last name of the contact.
optional, string, max chars=70 The email address.
optional, string, max chars=250 The company name.
optional, string, max chars=50 The phone number.
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 The name of the city.
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 The state/province name.
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
integer, min=0 The index number of the subscription to which the item price is added. Provide a unique number between 0
and 4
(inclusive) for each subscription that is to be created.
optional, contract_term Represents the contract terms when the 'estimate' operations are invoked. optional, contract_term
Represents the contract terms when the 'estimate' operations are invoked.
string, max chars=50 Id that uniquely identifies the contract term in the site.
enumerated string Current status of contract Possible values are
activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. Show all values[+]
timestamp(UTC) in seconds The start date of the contract term
timestamp(UTC) in seconds The end date of the contract term
integer, min=0 The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renew Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. Show all values[+]
in cents, default=0, min=0 The sum of the totals of all the invoices raised as part of the contract term. For active
contract terms, this is a predicted value. The value depends on the type of currency. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised
. total_contract_value_before_tax
in cents, default=0, min=0 It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for total_amount_raised_before_tax
is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes. cancellation_cutoff_period
optional, integer The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
timestamp(UTC) in seconds The date when the contract term was created.
string, max chars=50 The Id of the subscription that this contract term is for.
optional, integer, min=0 The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for active
contract terms.
boolean, default=true Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates. required, boolean, default=true
Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
enumerated string, default=tax_exclusive The price type of this invoice. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+] required, enumerated string, default=tax_exclusive
The price type of this invoice.
string, max chars=3 The currency code (ISO 4217 format) of the invoice. required, string, max chars=3
The currency code (ISO 4217 format) of the invoice.
in cents, min=0 Invoice sub-total in cents. required, in cents, min=0
Invoice sub-total in cents.
optional, in cents, default=0, min=0 Invoice total in cents. optional, in cents, default=0, min=0
Invoice total in cents.
optional, in cents, default=0, min=0 credits applied to this invoice in cents. optional, in cents, default=0, min=0
credits applied to this invoice in cents.
Credits applied attributes
optional, in cents, default=0, min=0 Existing outstanding payments if any, applied to this invoice in cents. optional, in cents, default=0, min=0
Existing outstanding payments if any, applied to this invoice in cents.
optional, in cents, default=0, min=0 Invoice amount due in cents optional, in cents, default=0, min=0
Invoice amount due in cents
optional, list of line_item The details of the line items in this invoice estimate.
Note
Line items that meet both the following conditions are not returned:
- The line item belongs to an item price whose parent item is
metered
.
- The
line_item.amount
is 0
.
optional, list of line_item The details of the line items in this invoice estimate.
Note
Line items that meet both the following conditions are not returned:
- The line item belongs to an item price whose parent item is
metered
.
- The
line_item.amount
is 0
.
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to
optional, list of discount The list of discounts applied to this estimate optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
.
optional, list of tax The list of taxes applied to this estimate optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item.
optional, list of line_item_tax The list of taxes applied on line items optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
optional, list of line_item_tier The list of tiers applicable for this line item optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
optional, list of line_item_credit A list of store credits applied to line items. optional, list of line_item_credit
A list of store credits applied to line items.
Line item credit attributes
string, max chars=50 The unique ID of the credit note from which the credit is applied.
double, default=0.0 The credit amount is applied to the line item.
optional, string, max chars=40 The unique ID of the line item to which this credit is applied.
optional, list of line_item_discount The list of discount(s) applied for each line item of this invoice. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
. optional, in cents, min=0
Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
Round off amount attributes
optional, string, max chars=100 A unique identifier for the customer this invoice belongs to optional, string, max chars=100
A unique identifier for the customer this invoice belongs to
optional, list of line_item_address The list of addresses used for tax calculation on line items. optional, list of line_item_address
The list of addresses used for tax calculation on line items.
Line item address attributes
optional, string, max chars=40 Line item reference
optional, string, max chars=150 First name of the customer
optional, string, max chars=150 Last name of the customer
optional, string, max chars=70 Email of the customer
optional, string, max chars=250 Name of the company
optional, string, max chars=50 Phone number of the customer
optional, string, max chars=150 Address line 1
optional, string, max chars=150 Address line 2
optional, string, max chars=150 Address line 3
optional, string, max chars=50 Name of the city
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
optional, string, max chars=50 State or Province
optional, string, max chars=50 The billing address of the customer, specified as an ISO 3166 alpha-2 code. Entering an invalid code will return an error.
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
string, max chars=40 An auto-generated unique identifier for the payment schedule. required, string, max chars=40
An auto-generated unique identifier for the payment schedule.
string, max chars=40 The identifier of the payment_schedule_scheme
, used to create the payment schedules. required, string, max chars=40
The identifier of the payment_schedule_scheme
, used to create the payment schedules.
enumerated string Specifies the modeled entity that the payment schedule is based on. Possible values are
invoiceRepresents an invoice.
required, enumerated string
Specifies the modeled entity that the payment schedule is based on.
optional, string, max chars=50 The identifier of the modeled entity that this payment schedule is based on. optional, string, max chars=50
The identifier of the modeled entity that this payment schedule is based on.
in cents, min=0 An amount that this payment schedule is able to collect. required, in cents, min=0
An amount that this payment schedule is able to collect.
optional, string, max chars=3 The currency code (ISO 4217 format) of the transaction amount. optional, string, max chars=3
The currency code (ISO 4217 format) of the transaction amount.
optional, list of schedule_entry List of schedule entries optional, list of schedule_entry
List of schedule entries
Schedule entry attributes
string, max chars=40 An auto-generated unique identifier for the payment schedule.
timestamp(UTC) in seconds The date when this payment schedule is scheduled.
in cents, min=0 The total maximum amount that this payment schedule is allowed to collect.
enumerated string Defines the status of each payment schedule. Possible values are
postedIndicates that the payment is posted.payment_dueIndicates that the payment is due.paidIndicates that the payment has been made.
postedIndicates that the payment is posted.payment_dueIndicates that the payment is due.paidIndicates that the payment has been made.
Show all values[+]
string, max chars=50 The reference invoice id required, string, max chars=50
The reference invoice id
Reference invoice id attributes
enumerated string Credit note types. Learn more about credit note types. Possible values are
adjustmentAdjustment Credit NoterefundableRefundable Credit NotestoreStore Credit Note
adjustmentAdjustment Credit NoterefundableRefundable Credit NotestoreStore Credit Note
Show all values[+] required, enumerated string Credit note types. Learn more about credit note types.
enumerated string, default=tax_exclusive The price type of this credit note. Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
Show all values[+] required, enumerated string, default=tax_exclusive
The price type of this credit note.
string, max chars=3 The currency code (ISO 4217 format) of the credit note. required, string, max chars=3
The currency code (ISO 4217 format) of the credit note.
in cents, min=0 Invoice sub-total in cents. required, in cents, min=0
Invoice sub-total in cents.
in cents, min=0 Credit note total in cents. required, in cents, min=0
Credit note total in cents.
in cents, min=0 Allocated credits in cents. required, in cents, min=0
Allocated credits in cents.
Amount allocated attributes
in cents, min=0 Remaining credits in cents required, in cents, min=0
Remaining credits in cents
Amount available attributes
optional, list of line_item The list of items in this estimate optional, list of line_item
The list of items in this estimate
optional, string, max chars=40 Uniquely identifies a line_item
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
timestamp(UTC) in seconds Start date of this line item.
timestamp(UTC) in seconds End date of this line item.
in cents Unit amount of the line item.
optional, integer, default=1 Quantity of the recurring item which is represented by this line item. For metered
line items, this value is updated from usages once when the invoice is generated as pending
and finally when the invoice is closed.
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
optional, enumerated string The pricing scheme for this item price. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+]
boolean, default=false Specifies whether this line item is taxed or not
optional, in cents, default=0, min=0 The tax amount charged for this item
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
optional, string, max chars=39 The decimal representation of the unit amount of the line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=39 The decimal representation of the amount for the line_item
, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
optional, in cents, min=0 Total discounts for this line item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
optional, boolean Indicates whether the line item is for a metered item.If true
, the item is metered; otherwise, it is non-metered.
optional, string, max chars=5 The percentage value applied to calculate the line item amount when percentage-based pricing is used.
optional, string, max chars=40 Invoice Reference Line Item ID
string, max chars=250 Detailed description about this line item.
optional, string, max chars=500 Detailed description about this item.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+]
optional, enumerated string The reason due to which the line item price/amount is exempted from tax. Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exemptproduct_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address
and shipping_address
have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.tax_not_configured_external_providerIf the tax is not configured for the country in 3rd party tax provider.
Show all values[+]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
optional, string, max chars=100 A unique identifier for the customer this line item belongs to
optional, list of discount The list of discounts applied to this estimate optional, list of discount
The list of discounts applied to this estimate
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, string, max chars=250 Description for this deduction.
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type]
is item_level_coupon
or document_level_coupon
.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to line item. The coupon id
is passed as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id is passed as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, enumerated string The type of discount that is applied to the line item. Relevant only when discounts[entity_type]
is one of item_level_discount
, item_level_coupon
, document_level_discount
, or document_level_coupon
Possible values are
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
fixed_amountwhen amount is applied as discountpercentagewhen percentage is applied as discount
Show all values[+]
optional, string, max chars=100 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id
.
optional, list of tax The list of taxes applied to this estimate optional, list of tax
The list of taxes applied to this estimate
string, max chars=100 The name of the tax applied. E.g. GST.
in cents, min=0 The tax amount.
optional, string, max chars=250 Description of the tax item.
optional, list of line_item_tax The list of taxes applied on line items optional, list of line_item_tax
The list of taxes applied on line items
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
string, max chars=100 The name of the tax applied
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
optional, timestamp(UTC) in seconds Indicates the service period end of the tax rate for the line item.
optional, timestamp(UTC) in seconds Indicates the service period start of the tax rate for the line item.
optional, bigdecimal, min=-1000000000, max=999999999.999999999 Indicates the prorated line item amount in cents.
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
in cents, min=0 The tax amount
optional, enumerated string The type of tax jurisdiction Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a county
cityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
Show all values[+]
optional, string, max chars=250 The name of the tax jurisdiction
optional, string, max chars=250 The tax jurisdiction code tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
optional, list of line_item_discount The list of discount(s) applied for each line item of this invoice. optional, list of line_item_discount
The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
string, max chars=50 The unique id of the line item that this deduction is for.
enumerated string The type of deduction and the amount to which it is applied. Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
.item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id
is available as entity_id
.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total
. The coupon id
is available as entity_id
.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id
is null
in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id
is null
in this case. The legacy credits feature is superseded by adjustment_credit_notes
. item_level_discountThe deduction is due to a discount applied to a line item of the invoice. The discount id
is available as the entity_id
. document_level_discountThe deduction is due to a discount applied to the invoice sub_total
. The discount id
is available as the entity_id
. Show all values[+]
optional, string, max chars=50 When the deduction is due to a coupon
or a discount
, then this is the id
of the coupon or discount.
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, list of line_item_tier The list of tiers applicable for this line item optional, list of line_item_tier
The list of tiers applicable for this line item
Line item tier attributes
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
optional, in cents, min=0 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
. optional, in cents, min=0
Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount
. If there is no round-off amount
, it will display 0
.
Round off amount attributes
optional, string, max chars=100 A unique identifier for the customer this credit note belongs to optional, string, max chars=100
A unique identifier for the customer this credit note belongs to
optional, string, max chars=40 Uniquely identifies an unbilled charge. optional, string, max chars=40
Uniquely identifies an unbilled charge.
optional, string, max chars=50 A unique identifier for the customer being charged. optional, string, max chars=50
A unique identifier for the customer being charged.
optional, string, max chars=50 A unique identifier for the subscription this charge belongs to. optional, string, max chars=50
A unique identifier for the subscription this charge belongs to.
Subscription id attributes
optional, timestamp(UTC) in seconds Start date of this charge. optional, timestamp(UTC) in seconds
Start date of this charge.
optional, timestamp(UTC) in seconds End date of this charge. optional, timestamp(UTC) in seconds
End date of this charge.
optional, in cents, min=0 Unit amount of the charge item. optional, in cents, min=0
Unit amount of the charge item.
optional, enumerated string The pricing scheme for this line item. Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.volumeThe per unit price is based on the tier that the total quantity falls in.
stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
Show all values[+] optional, enumerated string
The pricing scheme for this line item.
optional, integer, min=0 Quantity of the item which is represented by this charge. optional, integer, min=0
Quantity of the item which is represented by this charge.
optional, in cents, min=0 Total amount of this charge. Typically equals to unit amount x quantity. optional, in cents, min=0
Total amount of this charge. Typically equals to unit amount x quantity.
string, max chars=3 The currency code (ISO 4217 format) for the charge. required, string, max chars=3
The currency code (ISO 4217 format) for the charge.
optional, in cents, min=0 Total discounts for this charge. optional, in cents, min=0
Total discounts for this charge.
Discount amount attributes
optional, string, max chars=250 Detailed description about this charge. optional, string, max chars=250
Detailed description about this charge.
enumerated string Specifies the modelled entity this line item is based on. Possible values are
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this caseplan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+] required, enumerated string
Specifies the modelled entity this line item is based on.
optional, string, max chars=100 The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type. optional, string, max chars=100
The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.
boolean, default=false Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration. required, boolean, default=false
Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.
optional, timestamp(UTC) in seconds Timestamp indicating the date and time this charge got voided. optional, timestamp(UTC) in seconds
Timestamp indicating the date and time this charge got voided.
optional, string, max chars=39 The decimal representation of the amount for the charge, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled. optional, string, max chars=39 The decimal representation of the amount for the charge, in major units of the currency. Typically equals to unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled.
Unit amount in decimal attributes
optional, string, max chars=33 The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and multi-decimal pricing is enabled. optional, string, max chars=33 The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
Quantity in decimal attributes
optional, string, max chars=39 The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and multi-decimal pricing is enabled. optional, string, max chars=39 The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
Amount in decimal attributes
timestamp(UTC) in seconds Timestamp indicating when the unbilled charge was last updated required, timestamp(UTC) in seconds
Timestamp indicating when the unbilled charge was last updated
optional, list of line_item_tier The list of tiers applicable for this line item optional, list of line_item_tier
The list of tiers applicable for this line item
optional, string, max chars=40 Uniquely identifies a line_item
integer, min=0 The lower limit of a range of units for the tier
optional, integer The upper limit of a range of units for the tier
integer, min=0 The number of units purchased in a range.
in cents, min=0 The price of the tier if the charge model is a stairtstep
pricing , or the price of each unit in the tier if the charge model is tiered
/volume
pricing.
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the line_items.pricing_model
is tiered
, volume
or stairstep and multi-decimal pricing is enabled.
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for line_item
. The value is in major units of the currency. Returned when the line_item
is quantity-based and multi-decimal pricing is enabled.
optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+]
optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
optional, boolean, default=false The value of this parameter will be true if it is a recurring unbilled charge for a future term. optional, boolean, default=false
The value of this parameter will be true if it is a recurring unbilled charge for a future term.
Is advance charge attributes
optional, string, max chars=50 The unique ID of the
business entity of this subscription. This is always the same as the
business entity of the customer.
optional, string, max chars=50 The unique ID of the
business entity of this subscription. This is always the same as the
business entity of the customer.
Business entity id attributes
boolean Indicates that this resource has been deleted. required, boolean
Indicates that this resource has been deleted.
Generates an estimate for creating a subscription when the customer does not exist in Chargebee. This estimate API can be called when the customer has not yet signed up and you want to preview how a new subscription would look like for them.
Note: Estimate operations do not make any changes in Chargebee; hence this API does not create an actual customer
or subscription
record.
The response contains one or more of the following objects:
-
subscription_estimate
: The subscription details like the status of the subscription (such as in_trial
or active
), next billing date, and so on.
-
invoice_estimate
:The details of the immediate invoice, if there is one. If the subscription is created in trial
/future
states, invoice_estimate
is unavailable as no immediate invoice is generated.
-
next_invoice_estimate
:This is returned when an immediate invoice is not generated. It contains the details of the invoice that will be generated on the next billing date of the subscription.
-
unbilled_charge_estimates
: This contains the details of charges that have not been invoiced. This is returned only if the invoice_immediately
parameter is set to false
.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "customer[taxability]"="TAXABLE" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "customer[taxability]"="EXEMPT" \
-d "subscription_items[item_price_id][0]"="basic-USD-yearly" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "item_tiers[item_price_id][0]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][0]"=1 \
-d "item_tiers[ending_unit][0]"=10 \
-d "item_tiers[price][0]"=1000 \
-d "item_tiers[item_price_id][1]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][1]"=11 \
-d "item_tiers[ending_unit][1]"=20 \
-d "item_tiers[price][1]"=2500 \
-d "item_tiers[item_price_id][2]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][2]"=21 \
-d "item_tiers[price][2]"=4000
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "subscription_items[item_price_id][0]"="basic-USD-weekly"
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d invoice_immediately=false \
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "customer[taxability]"="TAXABLE" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "customer[taxability]"="TAXABLE" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
Create subscription with tier price override
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "customer[taxability]"="EXEMPT" \
-d "subscription_items[item_price_id][0]"="basic-USD-yearly" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "item_tiers[item_price_id][0]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][0]"=1 \
-d "item_tiers[ending_unit][0]"=10 \
-d "item_tiers[price][0]"=1000 \
-d "item_tiers[item_price_id][1]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][1]"=11 \
-d "item_tiers[ending_unit][1]"=20 \
-d "item_tiers[price][1]"=2500 \
-d "item_tiers[item_price_id][2]"="basic-USD-yearly" \
-d "item_tiers[starting_unit][2]"=21 \
-d "item_tiers[price][2]"=4000
Create subscription with trial
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "subscription_items[item_price_id][0]"="basic-USD-weekly"
Create subscription with unbilled charges
curl https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items \
-u {site_api_key}:\
-d invoice_immediately=false \
-d "billing_address[line1]"="PO Box 9999" \
-d "billing_address[city]"="Walnut" \
-d "billing_address[zip]"="91789" \
-d "billing_address[country]"="US" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1612964957,
"invoice_estimate": {
"amount_due": 1100,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOceaKFNz",
"date": 1612964957,
"line_item_discounts": [],
"line_item_taxes": [
{
"is_non_compliance_tax": false,
"is_partial_tax_applied": false,
"line_item_id": "li___test__8asyKSOceaN3O1",
"object": "line_item_tax",
"tax_amount": 91,
"tax_name": "Tax",
"tax_rate": 10,
"taxable_amount": 909
},
{..}
],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOceaKFNz",
"date_from": 1612964957,
"date_to": 1615384157,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOceaN3O1",
"is_taxed": true,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"tax_amount": 91,
"tax_rate": 10,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_inclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 1100,
"taxes": [
{
"amount": 100,
"description": "Tax @ 10%",
"name": "Tax",
"object": "tax"
},
{..}
],
"total": 1100
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"next_billing_at": 1615384157,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/estimates/create_subscription_for_items
optional, integer, min=0 The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used. mandatory_items_to_remove[[0..n]][0..n]
optional, integer, min=1 The number of subscription billing cycles (including the first one) to invoice in advance.
optional, enumerated string Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site. Possible values are
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
Show all values[+]
optional, list of string List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
optional, boolean If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
Note: invoice_immediately
only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
.
optional, timestamp(UTC) in seconds The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date.
taxes
and
line_item_taxes
are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December. subscription[[0..n]][0..n]
optional, string Parameters for subscription billing_address[[0..n]][0..n]
optional, string Parameters for billing_address shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address
optional, string Parameters for customer contract_term[[0..n]][0..n]
optional, enumerated string Parameters for contract_term subscription_items[[0..n]][0..n]
optional, array Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
optional, array Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices. tax_providers_fields[[0..n]][0..n]
optional, array Parameters for tax_providers_fields. Multiple tax_providers_fields can be passed by specifying unique indices.
Parameters for subscription
pass parameters as subscription[<param name>]
optional, string, max chars=50 A unique and immutable identifier for the subscription. If not provided, it is autogenerated. optional, timestamp(UTC) in seconds End of the trial period for the subscription. This overrides the trial period set for the plan-item. The value must be later than start_date
. Set it to 0
to have no trial period. optional, timestamp(UTC) in seconds The date/time at which the subscription is to start. If not provided, the subscription starts immediately. You can provide a value in the past as well. This is called backdating the subscription creation and is done when the subscription has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating is enabled for subscription creation operations.
- The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
- The date is not more than duration X into the past, where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April,
start_date
cannot be earlier than 14th February.
subscription[free_period] optional, integer, min=1 The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit. subscription[free_period_unit] optional, enumerated string The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen. Possible values are
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
Show all values[+] subscription[contract_term_billing_cycle_on_renewal] optional, integer, min=1, max=100 Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as billing_cycles
or a custom value depending on the site configuration. subscription[trial_end_action] optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+]
Parameters for billing_address
pass parameters as billing_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. billing_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
billing_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. shipping_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. shipping_address[country] optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
shipping_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for customer
pass parameters as customer[<param name>]
optional, string, max chars=20 VAT number of this customer. If not provided then taxes are not calculated for the estimate. Applicable only when taxes are configured for the EU or UK region. VAT validation is not done for this. customer[vat_number_prefix] optional, string, max chars=10 An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_address
country
as XI
(which is United Kingdom - Northern Ireland).
When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_address
country
as XI
. That’s the code for United Kingdom - Northern
Ireland. The first two characters of the VAT number in such a case is
XI
by default. However, if the VAT number was registered in UK, the value should be GB
. Set
vat_number_prefix
to GB
for such cases. customer[registered_for_gst] optional, boolean Confirms that a customer is registered under GST. If set to true
then the Reverse Charge Mechanism is applicable. This field is applicable only when Australian GST is configured for your site. optional, enumerated string, default=taxable Specifies if the customer is liable for tax Possible values are
taxableComputes tax for the customer based on the site configuration. In some cases, depending on the region, shipping_address is needed. If not provided, then billing_address is used to compute tax. If that’s not available either, the tax is taken as zero.exempt- Customer is exempted from tax. When using Chargebee’s native Taxes feature or when using the TaxJar integration, no other action is needed.
- However, when using our Avalara integration, optionally, specify
entity_code
or exempt_number
attributes if you use Chargebee’s AvaTax for Sales or specify exemption_details
attribute if you use Chargebee’s AvaTax for Communications integration. Tax may still be applied by Avalara for certain values of entity_code
/exempt_number
/exemption_details
based on the state/region/province of the taxable address.
taxableComputes tax for the customer based on the site configuration. In some cases, depending on the region, shipping_address is needed. If not provided, then billing_address is used to compute tax. If that’s not available either, the tax is taken as zero.exempt- Customer is exempted from tax. When using Chargebee’s native Taxes feature or when using the TaxJar integration, no other action is needed.
- However, when using our Avalara integration, optionally, specify
entity_code
or exempt_number
attributes if you use Chargebee’s AvaTax for Sales or specify exemption_details
attribute if you use Chargebee’s AvaTax for Communications integration. Tax may still be applied by Avalara for certain values of entity_code
/exempt_number
/exemption_details
based on the state/region/province of the taxable address.
Show all values[+] optional, enumerated string The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's AvaTax for Sales integration. Possible values are
aFederal governmentbState governmentcTribe/Status Indian/Indian BanddForeign diplomateCharitable or benevolent organizationfReligious organizationgResalehCommercial agricultural productioniIndustrial production/manufacturerjDirect pay permitkDirect maillOther or custommEducational organizationnLocal governmentpCommercial aquacultureqCommercial FisheryrNon-residentmed1US Medical Device Excise Tax with exempt sales taxmed2US Medical Device Excise Tax with taxable sales tax
aFederal governmentbState governmentcTribe/Status Indian/Indian BanddForeign diplomat
eCharitable or benevolent organizationfReligious organizationgResalehCommercial agricultural productioniIndustrial production/manufacturerjDirect pay permitkDirect maillOther or custommEducational organizationnLocal governmentpCommercial aquacultureqCommercial FisheryrNon-residentmed1US Medical Device Excise Tax with exempt sales taxmed2US Medical Device Excise Tax with taxable sales tax
Show all values[+] optional, string, max chars=100 Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable if you use Chargebee's AvaTax for Sales integration. customer[exemption_details] optional, jsonarray Indicates the exemption information. You can customize customer exemption based on specific Location, Tax level (Federal, State, County and Local), Category of Tax or specific Tax Name. This is applicable only if you use Chargebee’s AvaTax for Communications integration.
To know more about what values you need to provide, refer to this Avalara’s API document. optional, enumerated string Indicates the type of the customer. This is applicable only if you use Chargebee’s AvaTax for Communications integration. Possible values are
residentialWhen the purchase is made by a customer for home usebusinessWhen the purchase is made at a place of businesssenior_citizenWhen the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaksindustrialWhen the purchase is made by an industrial business
residentialWhen the purchase is made by a customer for home usebusinessWhen the purchase is made at a place of businesssenior_citizenWhen the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaksindustrialWhen the purchase is made by an industrial business
Show all values[+]
Parameters for contract_term
pass parameters as contract_term[<param name>]
contract_term[action_at_term_end] optional, enumerated string Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled. renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled. Show all values[+] contract_term[cancellation_cutoff_period] optional, integer, default=0 The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
pass parameters as subscription_items[<param name>][<idx:0..n>]
subscription_items[item_price_id][0..n] required, string, max chars=100 The unique identifier of the item price. subscription_items[quantity][0..n] optional, integer, min=1 The quantity of the item purchased subscription_items[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. subscription_items[unit_price][0..n] optional, in cents, min=0 The price/per unit price of the item. When not provided, the value set for the item price is used. This is only applicable when the pricing_model
of the item price is flat_fee
or per_unit
. Also, it is only allowed when price overriding is enabled for the site. The value depends on the type of currency. If changes_scheduled_at
is in the past and a unit_price
is not passed, then the item price’s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled. subscription_items[unit_price_in_decimal][0..n] subscription_items[billing_cycles][0..n] subscription_items[trial_end][0..n] optional, timestamp(UTC) in seconds The date/time when the trial period of the item ends. Applies to plan-items and—-when enabled-—addon-items as well. subscription_items[service_period_days][0..n] optional, integer, min=1, max=730 The service period of the item in days from the day of charge. subscription_items[charge_on_event][0..n] optional, enumerated string When charge_on_option
option is set to on_event
, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items. Possible values are
subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.contract_terminationwhen a contract term is terminated. subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.
contract_terminationwhen a contract term is terminated. Show all values[+] subscription_items[charge_once][0..n] optional, boolean Indicates if the charge-item is to be charged only once or each time the charge_on_event
occurs. This parameter only applies to charge-items. subscription_items[charge_on_option][0..n] optional, enumerated string Indicates when the charge-item is to be charged. This parameter only applies to charge-items. Possible values are
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
Show all values[+]
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]
discounts[apply_on][0..n] optional, enumerated string The amount on the invoice to which the discount is applied. Possible values are
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
Show all values[+] discounts[duration_type][0..n] required, enumerated string, default=forever Specifies the time duration for which this discount is attached to the subscription. Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. Show all values[+] discounts[percentage][0..n] optional, double, min=0.01, max=100.0 The percentage of the original amount that should be deducted from it. optional, integer, min=1 The duration of time for which the discount is attached to the subscription, in period_units
. Applicable only when duration_type
is limited_period
. discounts[period_unit][0..n] optional, enumerated string The unit of time for period
. Applicable only when duration_type
is limited_period
. Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
Show all values[+] discounts[included_in_mrr][0..n] optional, boolean The discount is included in MRR calculations for your site. This attribute is only applicable when duration_type
is one_time
and when the feature is enabled in Chargebee. Also, If the site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned false
. discounts[item_price_id][0..n] optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on
= specific_item_price
.
Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
pass parameters as item_tiers[<param name>][<idx:0..n>]
item_tiers[item_price_id][0..n] optional, string, max chars=100 The id of the item price for which the tier price is being overridden. item_tiers[starting_unit][0..n] optional, integer, min=1 The lowest value in the quantity tier. item_tiers[ending_unit][0..n] optional, integer The highest value in the quantity tier. optional, in cents, default=0, min=0 The overridden price of the tier. The value depends on the type of currency. item_tiers[starting_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[ending_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[price_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled. item_tiers[pricing_type][0..n] optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+] item_tiers[package_size][0..n] optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
Parameters for tax_providers_fields. Multiple tax_providers_fields can be passed by specifying unique indices.
pass parameters as tax_providers_fields[<param name>][<idx:0..n>]
tax_providers_fields[provider_name][0..n] optional, string, max chars=50 Name of the tax provider. tax_providers_fields[field_id][0..n] optional, string, max chars=50 Field id of the attribute which tax vendor has provided while getting onboarded with Chargebee. tax_providers_fields[field_value][0..n] optional, string, max chars=50 The value of the related tax field
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Generates an estimate without creating a subscription. This endpoint can be called when you want to preview details of a new subscription before actually creating one.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Notes
The following conditions must be met or tax calculation is ignored:
- The
taxability
attribute for the customer is true
. shipping_address
is passed when needed for tax calculation.
Sample Request
curl https://{site}.chargebee.com/api/v2/customers/__test__8aspfRrLYZEd2/create_subscription_for_items_estimate \
-X POST \
-u {site_api_key}:\
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
curl https://{site}.chargebee.com/api/v2/customers/__test__8aspfRrLYZEd2/create_subscription_for_items_estimate \
-X POST \
-u {site_api_key}:\
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
curl https://{site}.chargebee.com/api/v2/customers/__test__8aspfRrLYZEd2/create_subscription_for_items_estimate \
-X POST \
-u {site_api_key}:\
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[billing_cycles][0]"=2 \
-d "subscription_items[quantity][0]"=1 \
-d "subscription_items[item_price_id][1]"="day-pass-USD" \
-d "subscription_items[unit_price][1]"=100
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1612964956,
"invoice_estimate": {
"amount_due": 1100,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOcea0qNl",
"date": 1612964956,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOcea0qNl",
"date_from": 1612964956,
"date_to": 1615384156,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOcea6xNq",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 1100,
"taxes": [],
"total": 1100
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"next_billing_at": 1615384156,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/customers/{customer-id}/create_subscription_for_items_estimate
optional, boolean, default=true The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
optional, boolean If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
Note: invoice_immediately
only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
.
optional, integer, min=0 The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used. mandatory_items_to_remove[[0..n]][0..n]
optional, integer, min=1 The number of subscription billing cycles (including the first one) to invoice in advance.
optional, enumerated string Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site. Possible values are
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
Show all values[+]
optional, timestamp(UTC) in seconds The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date.
taxes
and
line_item_taxes
are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
optional, list of string List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes. subscription[[0..n]][0..n]
optional, string Parameters for subscription shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address billing_address[[0..n]][0..n]
optional, string Parameters for billing_address contract_term[[0..n]][0..n]
optional, enumerated string Parameters for contract_term subscription_items[[0..n]][0..n]
optional, array Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
optional, array Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
Parameters for subscription
pass parameters as subscription[<param name>]
optional, string, max chars=50 A unique and immutable identifier for the subscription. If not provided, it is autogenerated. optional, timestamp(UTC) in seconds End of the trial period for the subscription. This overrides the trial period set for the plan-item. The value must be later than start_date
. Set it to 0
to have no trial period. optional, timestamp(UTC) in seconds The date/time at which the subscription is to start. If not provided, the subscription starts immediately. You can provide a value in the past as well. This is called backdating the subscription creation and is done when the subscription has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating is enabled for subscription creation operations.
- The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
- The date is not more than duration X into the past, where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April,
start_date
cannot be earlier than 14th February.
subscription[free_period] optional, integer, min=1 The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit. subscription[free_period_unit] optional, enumerated string The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen. Possible values are
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
Show all values[+] subscription[contract_term_billing_cycle_on_renewal] optional, integer, min=1, max=100 Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as billing_cycles
or a custom value depending on the site configuration. subscription[trial_end_action] optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+]
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. shipping_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. shipping_address[country] optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
shipping_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for billing_address
pass parameters as billing_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. billing_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
billing_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for contract_term
pass parameters as contract_term[<param name>]
contract_term[action_at_term_end] optional, enumerated string Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled. renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled. Show all values[+] contract_term[cancellation_cutoff_period] optional, integer, default=0 The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
pass parameters as subscription_items[<param name>][<idx:0..n>]
subscription_items[item_price_id][0..n] required, string, max chars=100 The unique identifier of the item price. subscription_items[quantity][0..n] optional, integer, min=1 The quantity of the item purchased subscription_items[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. subscription_items[unit_price][0..n] optional, in cents, min=0 The price/per unit price of the item. When not provided, the value set for the item price is used. This is only applicable when the pricing_model
of the item price is flat_fee
or per_unit
. Also, it is only allowed when price overriding is enabled for the site. The value depends on the type of currency. If changes_scheduled_at
is in the past and a unit_price
is not passed, then the item price’s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled. subscription_items[unit_price_in_decimal][0..n] subscription_items[billing_cycles][0..n] subscription_items[trial_end][0..n] optional, timestamp(UTC) in seconds The date/time when the trial period of the item ends. Applies to plan-items and—-when enabled-—addon-items as well. subscription_items[service_period_days][0..n] optional, integer, min=1, max=730 The service period of the item in days from the day of charge. subscription_items[charge_on_event][0..n] optional, enumerated string When charge_on_option
option is set to on_event
, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items. Possible values are
subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.contract_terminationwhen a contract term is terminated. subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.
contract_terminationwhen a contract term is terminated. Show all values[+] subscription_items[charge_once][0..n] optional, boolean Indicates if the charge-item is to be charged only once or each time the charge_on_event
occurs. This parameter only applies to charge-items. subscription_items[charge_on_option][0..n] optional, enumerated string Indicates when the charge-item is to be charged. This parameter only applies to charge-items. Possible values are
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
Show all values[+]
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]
discounts[apply_on][0..n] optional, enumerated string The amount on the invoice to which the discount is applied. Possible values are
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
Show all values[+] discounts[duration_type][0..n] required, enumerated string, default=forever Specifies the time duration for which this discount is attached to the subscription. Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. Show all values[+] discounts[percentage][0..n] optional, double, min=0.01, max=100.0 The percentage of the original amount that should be deducted from it. optional, integer, min=1 The duration of time for which the discount is attached to the subscription, in period_units
. Applicable only when duration_type
is limited_period
. discounts[period_unit][0..n] optional, enumerated string The unit of time for period
. Applicable only when duration_type
is limited_period
. Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
Show all values[+] discounts[included_in_mrr][0..n] optional, boolean The discount is included in MRR calculations for your site. This attribute is only applicable when duration_type
is one_time
and when the feature is enabled in Chargebee. Also, If the site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned false
. discounts[item_price_id][0..n] optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on
= specific_item_price
.
Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
pass parameters as item_tiers[<param name>][<idx:0..n>]
item_tiers[item_price_id][0..n] optional, string, max chars=100 The id of the item price for which the tier price is being overridden. item_tiers[starting_unit][0..n] optional, integer, min=1 The lowest value in the quantity tier. item_tiers[ending_unit][0..n] optional, integer The highest value in the quantity tier. optional, in cents, default=0, min=0 The overridden price of the tier. The value depends on the type of currency. item_tiers[starting_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[ending_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[price_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled. item_tiers[pricing_type][0..n] optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+] item_tiers[package_size][0..n] optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Returns an estimate for updating a subscription.
In the response,
subscription_estimate
: The details of the changed subscription such as status
, next billing date, and so on.
invoice_estimate
:The details of the immediate invoice, if it is generated. An immediate invoice is not generated when:
end_of_term
parameter is true
prorate
parameter is false
- No changes are made to the plan item prices or addon item prices in
subscription_items
.
- For changes such as quantity downgrades.
next_invoice_estimate
:The details of the invoice to be generated later (if any) on the occasion that no immediate invoice has been generated.
credit_note_estimates
:The list of credit notes (if any) generated during this operation.
unbilled_charge_estimates
: The details of charges that have not been invoiced. This is returned only if the invoice_immediately
parameter is set to false
.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Notes
The following conditions must be met or tax calculation is ignored:
- The
taxability
attribute for the customer is true
. - Necessary parameters for tax calculation such as the following are passed:
billing_address
, shipping_address
, customer[vat_number]
Sample Request
curl https://{site}.chargebee.com/api/v2/estimates/update_subscription_for_items \
-u {site_api_key}:\
-d invoice_immediately=true \
-d "subscription[id]"="__test__8aspfRrLYaAEA" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[quantity][0]"=4 \
-d "subscription_items[unit_price][0]"=1000
curl https://{site}.chargebee.com/api/v2/estimates/update_subscription_for_items \
-u {site_api_key}:\
-d invoice_immediately=true \
-d "subscription[id]"="__test__8aspfRrLYaAEA" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[quantity][0]"=4 \
-d "subscription_items[unit_price][0]"=1000
curl https://{site}.chargebee.com/api/v2/estimates/update_subscription_for_items \
-u {site_api_key}:\
-d invoice_immediately=true \
-d "subscription[id]"="__test__8aspfRrLYaAEA" \
-d "subscription_items[item_price_id][0]"="basic-USD" \
-d "subscription_items[quantity][0]"=4 \
-d "subscription_items[unit_price][0]"=1000
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1612964966,
"credit_note_estimates": [],
"invoice_estimate": {
"amount_due": 3000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOcecJ8PM",
"date": 1612964966,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 3000,
"customer_id": "__test__8asyKSOcecJ8PM",
"date_from": 1612964966,
"date_to": 1615384165,
"description": "basic USD - Prorated Charges",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOcecf6PY",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 3,
"subscription_id": "__test__8asyKSOcecNUPP",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 3000,
"taxes": [],
"total": 3000
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOcecNUPP",
"next_billing_at": 1615384165,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/estimates/update_subscription_for_items
optional, timestamp(UTC) in seconds When change_option
is set to specific_date
, then set the date/time at which the subscription change is to happen or has happened. Note: It is recommended not to pass this parameter along with reactivate_from
. changes_scheduled_at
can be set to a value in the past. This is called backdating the subscription change and is performed when the subscription change has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating must be enabled for subscription change operations.
- Only the following changes can be backdated:
- Changes in the recurring items or their prices.
- Addition of non-recurring items.
- Subscription
status
is active
, cancelled
, or non_renewing
.
- The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is typically the day of the month by which the accounting for the previous month must be closed.
- The date is on or after
current_term_start
.
- The date is on or after the last date/time any of the following changes were made:
- Changes in the recurring items or their prices.
- Addition of non-recurring items.
- The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April,
changes_scheduled_at
cannot be earlier than 14th February.
.
optional, enumerated string Specifies the effective date for the subscription change. Possible values are
immediatelyThe change is carried out immediately.end_of_termThe change is carried out at the end of the current billing cycle of the subscription.specific_dateExecutes the change on a specified date. The change occurs as of the date/time defined in changes_scheduled_at
. immediatelyThe change is carried out immediately.end_of_termThe change is carried out at the end of the current billing cycle of the subscription.specific_dateExecutes the change on a specified date. The change occurs as of the date/time defined in changes_scheduled_at
. Show all values[+] mandatory_items_to_remove[[0..n]][0..n]
optional, boolean, default=false If true
then the existing subscription_items
list for the subscription is replaced by the one provided. If false
then the provided subscription_items
list gets added to the existing list.
optional, timestamp(UTC) in seconds The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if create_pending_invoices
is set to true
, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes and line_item_taxes are computed based on the tax configuration as of invoice_date
. When passing this parameter, the following prerequisites must be met:
invoice_date
must be in the past.
invoice_date
is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
- It is not earlier than
changes_scheduled_at
, reactivate_from
, or trial_end
.
invoice_immediately
is true
.
.
optional, integer, min=0 Billing cycles set for plan-item price is used by default.
optional, integer, min=1 The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge
is inclusive of this new term. See description for the force_term_reset
parameter to learn more about when a subscription term is reset.
optional, timestamp(UTC) in seconds If the subscription status
is cancelled
and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.
Note: It is recommended not to pass this parameter along with changed_scheduled_at
. reactivate_from
can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating must be enabled for subscription reactivation operations.
- The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
- The date is on or after the last date/time any of the product catalog items of the subscription were changed.
- The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April,
changes_scheduled_at
cannot be earlier than 14th February.
.
optional, enumerated string Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing. Possible values are
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
Show all values[+]
optional, list of string List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
optional, boolean, default=false If true
then the existing coupon_ids
list for the subscription is replaced by the one provided. If false
then the provided list gets added to the existing coupon_ids
.
optional, boolean
- When
true
: Prorated credits or charges are created as applicable for this change.
- When
false
: The subscription is changed without creating any credits or charges.
- When not provided, the value configured in the site settings is considered.
Caveat
For further changes within the same billing term, when prorate
is set to true
, credits are not created when all the conditions below hold true:
An immediate previous change was made
- with
prorate
set to false
and
- no changes were made to the subscription’s billing term and
- a change was made to either the subscription’s items or their prices.
optional, boolean, default=false Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
optional, boolean, default=false Say the subscription has the renewal date as 28th of every month. When the plan-item price of the subscription is set to one that has the same billing period as the current plan-item price, the subscription change does not change the term. In other words, the subscription still renews on the 28th. Passing this parameter as true
will have the subscription reset its term to the current date (provided end_of_term
is false).
Note: When the new plan-item price has a billing period different from the current plan-item price of the subscription, the term is always reset, regardless of the value passed for this parameter.
optional, boolean Applicable only for cancelled
subscriptions. When passed as true
, the canceled subscription is activated; otherwise subscription changes are made without changing its status
. If not passed, subscription will be activated only if subscription_items
is passed. include_delayed_charges[]
optional, boolean, default=false If true, all the unbilled charges will be included for the invoice estimate.
optional, boolean, default=true The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
optional, boolean If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
Note: invoice_immediately
only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
.
optional, boolean, default=false Setting this attribute to true
will invoice the overages for the metered item during subscription changes
. subscription[[0..n]][0..n]
optional, string Parameters for subscription billing_address[[0..n]][0..n]
optional, string Parameters for billing_address shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address
optional, string Parameters for customer subscription_items[[0..n]][0..n]
optional, array Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
optional, array Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
Parameters for subscription
pass parameters as subscription[<param name>]
required, string, max chars=50 A unique and immutable identifier for the subscription. If not provided, it is autogenerated. optional, timestamp(UTC) in seconds The new start date of a future
subscription. Applicable only for future
subscriptions. optional, timestamp(UTC) in seconds The time at which the trial has ended or will end for the subscription. This is only allowed when the subscription status
is future
, in_trial
, or cancelled
. Also, the value must not be earlier than changes_scheduled_at
or start_date
. Note: This parameter can be backdated (set to a value in the past) only when the subscription is in cancelled
or in_trial
status
. Do this to keep a record of when the trial ended in case it ended at some point in the past. When trial_end
is backdated, the subscription immediately goes into active
or non_renewing
status. subscription[auto_collection] optional, enumerated string Defines whether payments need to be collected automatically for this subscription. Overrides customer's auto-collection property. Possible values are
onWhenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.offAutomatic collection of charges will not be made for this subscription. Use this for offline payments.
onWhenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.offAutomatic collection of charges will not be made for this subscription. Use this for offline payments.
Show all values[+] subscription[offline_payment_method] optional, enumerated string The preferred offline payment method for the subscription. Possible values are
no_preferenceNo PreferencecashCashcheckCheckbank_transferBank Transferach_creditACH Creditsepa_creditSEPA CreditboletoBoletous_automated_bank_transferUS Automated Bank Transfereu_automated_bank_transferEU Automated Bank Transferuk_automated_bank_transferUK Automated Bank Transferjp_automated_bank_transferJP Automated Bank Transfermx_automated_bank_transferMX Automated Bank TransfercustomCustom
no_preferenceNo PreferencecashCashcheckCheckbank_transferBank Transfer
ach_creditACH Creditsepa_creditSEPA CreditboletoBoletous_automated_bank_transferUS Automated Bank Transfereu_automated_bank_transferEU Automated Bank Transferuk_automated_bank_transferUK Automated Bank Transferjp_automated_bank_transferJP Automated Bank Transfermx_automated_bank_transferMX Automated Bank TransfercustomCustom
Show all values[+] subscription[free_period] optional, integer, min=1 The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit. subscription[free_period_unit] optional, enumerated string The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen. Possible values are
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
dayCharge based on day(s)weekCharge based on week(s)monthCharge based on month(s)yearCharge based on year(s)
Show all values[+] subscription[trial_end_action] optional, enumerated string Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription 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. Possible values are
site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. site_defaultThis is the default value. The action configured for the site at the time when the trial ends, takes effect.plan_defaultThe action configured for the site at the time when the trial ends, takes effect.activate_subscriptionThe subscription activates and charges are raised for non-metered items.cancel_subscriptionThe subscription cancels. Show all values[+]
Parameters for billing_address
pass parameters as billing_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. billing_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
billing_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. shipping_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. shipping_address[country] optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
shipping_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for customer
pass parameters as customer[<param name>]
optional, string, max chars=20 VAT number of this customer. If not provided then taxes are not calculated for the estimate. Applicable only when taxes are configured for the EU or UK region. VAT validation is not done for this. customer[vat_number_prefix] optional, string, max chars=10 An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_address
country
as XI
(which is United Kingdom - Northern Ireland).
When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_address
country
as XI
. That’s the code for United Kingdom - Northern
Ireland. The first two characters of the VAT number in such a case is
XI
by default. However, if the VAT number was registered in UK, the value should be GB
. Set
vat_number_prefix
to GB
for such cases. customer[registered_for_gst] optional, boolean Confirms that a customer is registered under GST. If set to true
then the Reverse Charge Mechanism is applicable. This field is applicable only when Australian GST is configured for your site.
Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
pass parameters as subscription_items[<param name>][<idx:0..n>]
subscription_items[item_price_id][0..n] required, string, max chars=100 The unique identifier of the item price. subscription_items[quantity][0..n] optional, integer, min=1 The quantity of the item purchased subscription_items[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. subscription_items[unit_price][0..n] optional, in cents, min=0 The price/per unit price of the item. When not provided, the value set for the item price is used. This is only applicable when the pricing_model
of the item price is flat_fee
or per_unit
. Also, it is only allowed when price overriding is enabled for the site. The value depends on the type of currency. If changes_scheduled_at
is in the past and a unit_price
is not passed, then the item price’s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled. subscription_items[unit_price_in_decimal][0..n] optional, string, max chars=39 When price overriding is enabled for the site, the price or per-unit price of the item can be set here. The value set for the item price is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled. If changes_scheduled_at
is in the past and a unit_price_in_decimal
is not passed, then the item price’s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled. subscription_items[billing_cycles][0..n] subscription_items[trial_end][0..n] optional, timestamp(UTC) in seconds The date/time when the trial period of the item ends. Applies to plan-items and—-when enabled-—addon-items as well. subscription_items[service_period_days][0..n] optional, integer, min=1, max=730 The service period of the item in days from the day of charge. subscription_items[charge_on_event][0..n] optional, enumerated string When charge_on_option
option is set to on_event
, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items. Possible values are
subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.contract_terminationwhen a contract term is terminated. subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.
contract_terminationwhen a contract term is terminated. Show all values[+] subscription_items[charge_once][0..n] optional, boolean Indicates if the charge-item is to be charged only once or each time the charge_on_event
occurs. This parameter only applies to charge-items. subscription_items[charge_on_option][0..n] optional, enumerated string Indicates when the charge-item is to be charged. This parameter only applies to charge-items. Possible values are
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
Show all values[+] subscription_items[proration_type][0..n] optional, enumerated string Note Applicable only for item prices with:
Specifies how to manage charges or credits for the addon item price for this subscription update estimate. You may use this parameter only if the change to the subscription takes effect immediately
. Possible values are
full_termCharge the full price of the addon or give the full credit. Don't apply any proration.partial_termProrate the charges or credits for the rest of the current term.noneDon't apply any charges or credits for the addon.
full_termCharge the full price of the addon or give the full credit. Don't apply any proration.partial_termProrate the charges or credits for the rest of the current term.noneDon't apply any charges or credits for the addon.
Show all values[+]
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]
discounts[apply_on][0..n] optional, enumerated string The amount on the invoice to which the discount is applied. Possible values are
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
Show all values[+] discounts[duration_type][0..n] required, enumerated string, default=forever Specifies the time duration for which this discount is attached to the subscription. Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
. Show all values[+] discounts[percentage][0..n] optional, double, min=0.01, max=100.0 The percentage of the original amount that should be deducted from it. optional, integer, min=1 The duration of time for which the discount is attached to the subscription, in period_units
. Applicable only when duration_type
is limited_period
. discounts[period_unit][0..n] optional, enumerated string The unit of time for period
. Applicable only when duration_type
is limited_period
. Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
Show all values[+] discounts[included_in_mrr][0..n] optional, boolean The discount is included in MRR calculations for your site. This attribute is only applicable when duration_type
is one_time
and when the feature is enabled in Chargebee. Also, If the site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned false
. discounts[item_price_id][0..n] optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on
= specific_item_price
. discounts[operation_type][0..n] required, enumerated string The operation to be carried out for the discount. Possible values are
addThe discount is attached to the subscription.removeThe discount (given by discounts[id]
) is removed from the subscription. Subsequent invoices will no longer have the discount applied. Tip: If you want to replace a discount, remove
it and add
another in the same API call.
addThe discount is attached to the subscription.removeThe discount (given by discounts[id]
) is removed from the subscription. Subsequent invoices will no longer have the discount applied. Tip: If you want to replace a discount, remove
it and add
another in the same API call.
Show all values[+] optional, string, max chars=50 An immutable unique id for the discount. It is always auto-generated.
Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
pass parameters as item_tiers[<param name>][<idx:0..n>]
item_tiers[item_price_id][0..n] optional, string, max chars=100 The id of the item price for which the tier price is being overridden. item_tiers[starting_unit][0..n] optional, integer, min=1 The lowest value in the quantity tier. item_tiers[ending_unit][0..n] optional, integer The highest value in the quantity tier. optional, in cents, default=0, min=0 The overridden price of the tier. The value depends on the type of currency. item_tiers[starting_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[ending_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[price_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled. item_tiers[pricing_type][0..n] optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+] item_tiers[package_size][0..n] optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
In the response,
- estimate.subscription_estimate has the current subscription details like its status, next billing date, and so on.
- estimate.invoice_estimate has details of the invoice that will be generated at the next billing date.
The generated invoice estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
To exclude the delayed charges from the invoice estimate, specify 'false' for the parameter include_delayed_charges.
Note:
- This API will not generate a renewal invoice if an advance invoice is already present for the subscription.
- For 'Non Renewing' subscriptions, only the delayed charges will be included in the invoice estimate.
- This API is not supported for 'Cancelled' subscriptions.
- Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the Upcoming Invoices estimate available for the Customer object to get the actual estimate invoice for the customer.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZXgNK/renewal_estimate \
-u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZXgNK/renewal_estimate \
-u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZXgNK/renewal_estimate \
-u {site_api_key}:
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492955,
"invoice_estimate": {
"amount_due": 1000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOceZS2ND",
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOceZS2ND",
"date_from": 1519912154,
"date_to": 1522590554,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOceZjINU",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__8asyKSOceZXgNK",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 1000,
"taxes": [],
"total": 1000
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOceZXgNK",
"next_billing_at": 1519912154,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
GET
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/renewal_estimate
include_delayed_charges[]
optional, boolean, default=true If true, all the unbilled charges will be included for the invoice estimate.
optional, boolean, default=true The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances. ignore_scheduled_cancellation[]
optional, boolean, default=false if true, ignores scheduled cancellation for non renewing subscription. ignore_scheduled_changes[]
optional, boolean, default=false If true, ignores all recurring charges scheduled during renewal.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
This API is used to generate an invoice estimate for preview. Estimate details include the number of billing cycles to be invoiced in advance, the number of billing cycles in one interval, advance invoicing schedules, and so on.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVkjcSAl6gBw1/advance_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=false \
-d terms_to_charge=3
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVkjcSAl6gBw1/advance_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=false \
-d terms_to_charge=3
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVkjcSAl6gBw1/advance_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=false \
-d terms_to_charge=3
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492806,
"object": "estimate",
"unbilled_charge_estimates": [
{
"amount": 895,
"currency_code": "USD",
"customer_id": "__test__KyVkjcSAl6gBw1",
"date_from": 1519912004,
"date_to": 1522590404,
"deleted": false,
"description": "No Trial",
"discount_amount": 0,
"entity_id": "no_trial",
"entity_type": "plan",
"id": "li___test__KyVkjcSAl6gcKF",
"is_voided": false,
"object": "unbilled_charge",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__KyVkjcSAl6gBw1",
"unit_amount": 895
},
{..}
]
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/advance_invoice_estimate
optional, integer, default=1, min=1 - For
schedule_type = immediate
: the number of future billing cycles to be invoiced in advance. The invoicing is done for the remaining_billing_cycles
of the subscription if that is less than terms_to_charge
. - For
schedule_type = fixed_intervals
: The number of future billing cycles in one interval. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles of the subscription.
.
optional, boolean Whether the charge should be invoiced immediately or added to unbilled_charges
. Applicable only when schedule_type
is immediate
.
optional, enumerated string The type of advance invoice or advance invoicing schedule. fixed_interval_schedule[[0..n]][0..n]
optional, integer Parameters for fixed_interval_schedule specific_dates_schedule[[0..n]][0..n]
optional, array Parameters for specific_dates_schedule. Multiple specific_dates_schedule can be passed by specifying unique indices.
+
fixed_interval_schedule
Parameters for fixed_interval_schedule
pass parameters as fixed_interval_schedule[<param name>]
fixed_interval_schedule[number_of_occurrences] optional, integer, min=1 The number of advance invoices to generate. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles
of the subscription. This parameter is applicable only when fixed_interval_schedule[end_schedule_on]
= after_number_of_intervals
fixed_interval_schedule[days_before_renewal] optional, integer, min=1 The number of days before each interval that advance invoices are generated. fixed_interval_schedule[end_schedule_on] optional, enumerated string Specifies when the schedule should end. Possible values are
after_number_of_intervalsAdvance invoices are generated a specified number of times
specific_dateEnd the advance invoicing schedule on a specific date
.subscription_endAdvance invoices are generated for as long as the subscription is active.
after_number_of_intervalsAdvance invoices are generated a specified number of times
specific_dateEnd the advance invoicing schedule on a specific date
.subscription_endAdvance invoices are generated for as long as the subscription is active.
Show all values[+] fixed_interval_schedule[end_date] optional, timestamp(UTC) in seconds The date when the schedule should end. Advance invoices are not generated beyond this date. It must be at least 1 day before the start of the last billing cycle of the subscription and also within 5 years from the current date. This parameter is only applicable when fixed_interval_schedule[end_schedule_on]
= specific_date
. +
specific_dates_schedule
Parameters for specific_dates_schedule. Multiple specific_dates_schedule can be passed by specifying unique indices.
pass parameters as specific_dates_schedule[<param name>][<idx:0..n>]
specific_dates_schedule[terms_to_charge][0..n] optional, integer The number of billing cycles to charge for, on the date specified. Applicable only when schedule_type
is specific_dates. specific_dates_schedule[date][0..n] optional, timestamp(UTC) in seconds The unique id of the member of the advance_invoice_schedule array which corresponds to the specific_dates_schedule that you intend to modify. Only applicable when schedule_type
is specific_dates
.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Regenerates the invoice for the current term of the subscription. The subscription must have status
as active
or non_renewing
. This operation is not allowed when any of the following conditions hold true for the subscription:
- An invoice exists for the current term and its
status
is not voided
.
- There are unbilled charges for the current term.
- The subscription has an advance invoice.
Response
Returns an estimate
object with one of the following components depending on the value of invoice_immediately
.
- If the value is
true
: an invoice_estimate
object that corresponds to the regenerated invoice.
- If the value is
false
: a list of unbilled_charge_estimate
objects corresponding to all the unbilled charges created for the current term of the subscription.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnOuSHufvfo16/regenerate_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=true
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnOuSHufpzqv/regenerate_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=false \
-d date_from=1518344700 \
-d date_to=1519381500 \
-d prorate=true
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnOuSHufvfo16/regenerate_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=true
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnOuSHufvfo16/regenerate_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=true
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnOuSHufpzqv/regenerate_invoice_estimate \
-u {site_api_key}:\
-d invoice_immediately=false \
-d date_from=1518344700 \
-d date_to=1519381500 \
-d prorate=true
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517480722,
"invoice_estimate": {
"amount_due": 895,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__KyVnOuSHufvfo16",
"date": 1517480722,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 895,
"customer_id": "__test__KyVnOuSHufvfo16",
"date_from": 1517480722,
"date_to": 1519899922,
"description": "No Trial",
"discount_amount": 0,
"entity_id": "no_trial",
"entity_type": "plan",
"id": "li___test__KyVnOuSHufvn81H",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__KyVnOuSHufvfo16",
"tax_amount": 0,
"unit_amount": 895
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 895,
"taxes": [],
"total": 895
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__KyVnOuSHufvfo16",
"next_billing_at": 1519899922,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/regenerate_invoice_estimate
optional, timestamp(UTC) in seconds The start date of the period being invoiced. The default value is current_term_start.
optional, timestamp(UTC) in seconds The end date of the period being invoiced. The default value is current_term_end.
optional, boolean Whether the charges should be prorated according to the term specified by date_from
and date_to
. Should not be passed without date_from
and date_to
.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Estimate of the upcoming scheduled invoices (subscription activations, renewals etc) of a customer. For now preview of the invoices generated on the immediate upcoming date is supported. Say a customer has couple of subscription renewals scheduled on Jan,10th and another subscription renewal scheduled on Jan,15th. This API gives the preview of all the invoices scheduled to be generated on Jan,10th (immediate upcoming date).
In the response:
- estimate.invoice_estimates[] has details of the invoices scheduled to be generated.
Note: If consolidated invoicing is enabled you may use this API to test whether upcoming renewals are consolidated.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/customers/__test__8asyKSOcec7pP6/upcoming_invoices_estimate \
-u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/customers/__test__8asyKSOcec7pP6/upcoming_invoices_estimate \
-u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/customers/__test__8asyKSOcec7pP6/upcoming_invoices_estimate \
-u {site_api_key}:
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492965,
"invoice_estimates": [
{
"amount_due": 2000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOcec7pP6",
"date": 1517492965,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOcec7pP6",
"date_from": 1517492965,
"date_to": 1519912165,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOcecDPPF",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__8asyKSOcecBvPD",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 2000,
"taxes": [],
"total": 2000
},
{..}
],
"object": "estimate"
}
}
URL Format
GET
https://{site}.chargebee.com/api/v2/customers/{customer-id}/upcoming_invoices_estimate
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Generates an estimate for the 'change term end' operation. This is similar to the Change term end API but the subscription’s term end will not be changed, only an estimate for this operation is created. This is applicable only for subscriptions in ‘in-trial’, ‘active’ and ‘non-renewing’ states.
In the response,
- estimate.subscription_estimate has the subscription details like the status of the subscription (in_trial, active, etc.), next billing date, and so on.
- estimate.invoice_estimate has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen when
- prorate parameter is false, or
- invoice_immediately parameter is false, or
- subscription is in in-trial state
- estimate.credit_note_estimates[] has details of the credit-notes that will get generated during this operation. This list will be empty if no credit-note gets generated during this operation.
- estimate.unbilled_charge_estimates[] has details of the unbilled charges. This is returned only if invoice_immediately is set as false.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZF8N6/change_term_end_estimate \
-u {site_api_key}:\
-d term_ends_at=1566697500
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZF8N6/change_term_end_estimate \
-u {site_api_key}:\
-d term_ends_at=1566697500
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOceZF8N6/change_term_end_estimate \
-u {site_api_key}:\
-d term_ends_at=1566697500
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492954,
"credit_note_estimates": [],
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOceZF8N6",
"next_billing_at": 1566697500,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/change_term_end_estimate
required, timestamp(UTC) in seconds The time at which the current term should end for this subscription.
optional, boolean Applicable for active / non_renewing subscriptions. If specified as true prorated charges / credits will be added during this operation.
optional, boolean If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
Note: invoice_immediately
only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Creates an estimate for canceling the specified subscription.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8ass3SIVLJaId/cancel_subscription_for_items_estimate \
-u {site_api_key}:\
-d credit_option_for_current_term_charges="PRORATE" \
-d end_of_term=false
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8ass3SIVLJaId/cancel_subscription_for_items_estimate \
-u {site_api_key}:\
-d credit_option_for_current_term_charges="PRORATE" \
-d end_of_term=false
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8ass3SIVLJaId/cancel_subscription_for_items_estimate \
-u {site_api_key}:\
-d credit_option_for_current_term_charges="PRORATE" \
-d end_of_term=false
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1612964956,
"credit_note_estimates": [
{
"amount_allocated": 1100,
"amount_available": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOceZlINV",
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOceZlINV",
"date_from": 1612964956,
"date_to": 1615384155,
"description": "basic USD - Prorated Credits for 10-Feb-2021 - 10-Mar-2021",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOceZyANi",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__8asyKSOceZpONY",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "credit_note_estimate",
"price_type": "tax_exclusive",
"reference_invoice_id": "__demo_inv__4",
"round_off_amount": 0,
"sub_total": 1100,
"taxes": [],
"total": 1100,
"type": "adjustment"
},
{..}
],
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOceZpONY",
"object": "subscription_estimate",
"status": "cancelled"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate
optional, enumerated string If the subscription does not have a contract term:
Determines when to cancel the subscription.
If the subscription has a contract term:
This parameter is not applicable.
Possible values are
immediatelyThis is used to cancel the subscription with immediate effectend_of_termThis is used to cancel a subscription at the end of the current billing cyclespecific_dateThis is used to cancel a subscription on a specified date. The change occurs as of the date/time defined in cancel_at
end_of_billing_termThis is used to cancel a subscription either at the end of the advance term, if it's billed for future renewals or at the end of its current billing cycle
immediatelyThis is used to cancel the subscription with immediate effectend_of_termThis is used to cancel a subscription at the end of the current billing cyclespecific_dateThis is used to cancel a subscription on a specified date. The change occurs as of the date/time defined in cancel_at
end_of_billing_termThis is used to cancel a subscription either at the end of the advance term, if it's billed for future renewals or at the end of its current billing cycle
Show all values[+]
optional, boolean, default=false (Deprecated) Use cancel_option
instead.
Applicable only when the subscription does not have contract terms.
Set this to true
if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription status
changes to non_renewing
.
optional, timestamp(UTC) in seconds If the subscription does not have a contract term:
Specifies the date and time when the subscription should be canceled. Do not use this parameter when end_of_term
is set to true
.
If the subscription has a contract term:
Applicable only when contract_term_cancel_option
is specific_date
. Specifies the date and time to cancel the subscription and contract term.
Backdating
You can set a past date to backdate the cancellation. Backdating is allowed only if the following conditions are met:
- Backdating is enabled for subscription cancellation.
- The current date does not exceed the backdating limit configured in Chargebee Billing.
- The date is on or after the
current_term_start
. - The date is on or after the most recent change involving:
- Addition/change/removal of plan or addon item prices.
- Addition of charge item prices.
- The date is not more than one billing period into the past. For example, if the plan’s billing period is two months and today is April 14,
cancel_at
cannot be earlier than February 14.
credit_option_for_current_term_charges[]
optional, enumerated string If the subscription does not have a contract term:
Specifies how to handle credits for current term charges when canceling immediately (i.e., cancel_option
is immediately
). If not specified, the site-level setting is used.
If the subscription has a contract term:
Specifies how to handle credits for current term charges when contract_term_cancel_option
is terminate_immediately
. If not specified, the site-level setting is used.
Possible values are
noneNo credits notes are created.prorateProrated credits are issued.fullCredits are issues for the full value of the current term charges.
noneNo credits notes are created.prorateProrated credits are issued.fullCredits are issues for the full value of the current term charges.
Show all values[+] unbilled_charges_option[]
optional, enumerated string If the subscription does not have a contract term:
Specifies how to handle unbilled charges when canceling immediately (i.e., cancel_option
is immediately
). If not specified, the site-level setting is used.
If the subscription has a contract term:
Specifies how to handle unbilled charges when contract_term_cancel_option
is terminate_immediately
. If not specified, the site-level setting is used.
Possible values are
invoiceAn invoice is generated immediately with the unbilled charges.deleteThe unbilled charges are deleted.
invoiceAn invoice is generated immediately with the unbilled charges.deleteThe unbilled charges are deleted.
Show all values[+] account_receivables_handling[]
optional, enumerated string If the subscription does not have a contract term:
Specifies how to handle past due invoices when canceling immediately (i.e., cancel_option
is immediately
). If not specified, the site-level setting is used.
If the subscription has a contract term:
Specifies how to handle past due invoices when contract_term_cancel_option
is terminate_immediately
. If not specified, the site-level setting is used.
Possible values are
no_actionNo action is taken.schedule_payment_collectionApplies excess payments and refundable credits to past due invoices. If any amount remains and auto_collection
is on
, the remaining amount is automatically charged to the available payment method.write_offApplies excess payments and refundable credits to past due invoices. Any remaining balance is written off.
Note: The credit note for the write-off is not included in the API response.
no_actionNo action is taken.schedule_payment_collectionApplies excess payments and refundable credits to past due invoices. If any amount remains and auto_collection
is on
, the remaining amount is automatically charged to the available payment method.write_offApplies excess payments and refundable credits to past due invoices. Any remaining balance is written off.
Note: The credit note for the write-off is not included in the API response.
Show all values[+] refundable_credits_handling[]
optional, enumerated string If the subscription does not have a contract term:
Specifies how to handle refundable credits when canceling immediately (i.e., cancel_option
is immediately
). If not specified, the site-level setting is used.
If the subscription has a contract term:
Specifies how to handle refundable credits when contract_term_cancel_option
is terminate_immediately
. If not specified, the site-level setting is used.
Possible values are
no_actionNo action is taken.schedule_refundRefunds remaining credits after applying them to any past due invoices.
no_actionNo action is taken.schedule_refundRefunds remaining credits after applying them to any past due invoices.
Show all values[+] contract_term_cancel_option[]
optional, enumerated string Required when the subscription has a contract term. Determines when to cancel the subscription along with the contract term.
Possible values are
terminate_immediatelyCancels the subscription and contract term immediately. Sets the contract term’s status
to terminated
and collects any termination fee, if applicable.
To specify the termination fee, include a single object in the subscription_items
array. If not specified, the default termination fee is applied (if configured).
end_of_contract_termPrevents the contract term from renewing and schedules the subscription for cancellation at the end of the contract term.
specific_dateCancels the subscription and contract term on the date specified by cancel_at
. Sets action_at_term_end
to cancel
.
Note: Contact Chargebee Support to enable this option for your Chargebee site.
end_of_subscription_billing_termCancels the subscription and contract term at the end of the current billing cycle. Sets action_at_term_end
to cancel
.
Note: Contact Chargebee Support to enable this option for your Chargebee site.
terminate_immediatelyCancels the subscription and contract term immediately. Sets the contract term’s status
to terminated
and collects any termination fee, if applicable.
To specify the termination fee, include a single object in the subscription_items
array. If not specified, the default termination fee is applied (if configured).
end_of_contract_termPrevents the contract term from renewing and schedules the subscription for cancellation at the end of the contract term.
specific_dateCancels the subscription and contract term on the date specified by cancel_at
. Sets action_at_term_end
to cancel
.
Note: Contact Chargebee Support to enable this option for your Chargebee site.
end_of_subscription_billing_termCancels the subscription and contract term at the end of the current billing cycle. Sets action_at_term_end
to cancel
.
Note: Contact Chargebee Support to enable this option for your Chargebee site.
Show all values[+]
optional, timestamp(UTC) in seconds The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if create_pending_invoices
is true
, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes
and line_item_taxes
are computed based on the tax
configuration as of invoice_date
. When passing this parameter, the following prerequisites must be met:
invoice_date
must be in the past.
invoice_date
is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
- It is not earlier than
cancel_at
.
.
optional, string, max chars=100 Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Subscriptions > Subscription Cancellation. Must be passed if set as mandatory in the app. The codes are case-sensitive. subscription_items[[0..n]][0..n]
optional, array Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
pass parameters as subscription_items[<param name>][<idx:0..n>]
subscription_items[item_price_id][0..n] optional, string, max chars=100 The unique id
of the charge item_price that represents the termination fee. subscription_items[quantity][0..n] optional, integer, min=1 The quantity associated with the termination fee. Applicable only when the item_price for the termination charge is quantity-based. subscription_items[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. subscription_items[unit_price][0..n] optional, in cents, min=0 The termination fee. In case it is quantity-based, this is the fee per unit. subscription_items[unit_price_in_decimal][0..n] subscription_items[service_period_days][0..n] optional, integer, min=1, max=730 The service period of the termination fee—expressed in days—starting from the current date.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
This API provides an estimate of the details pertaining to the pause_subscription
operation. It returns attributes such as pause_date
and resume_date
. This is similar to the Pause a subscription API with the exception that the subscription is not paused. Only an estimate for this operation is created.
In the response,
- estimate.subscription_estimate has the subscription details.
- estimate.invoice_estimate has details of the invoice that are generated immediately. This is not present if no immediate invoices are generated for this operation.
- estimate.credit_note_estimates[] has details of the credit notes that are generated during this operation. This list is empty if no credit notes are generated.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebl8Oi/pause_subscription_estimate \
-u {site_api_key}:\
-d pause_option="SPECIFIC_DATE" \
-d "subscription[pause_date]"=1566698400
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebl8Oi/pause_subscription_estimate \
-u {site_api_key}:\
-d pause_option="SPECIFIC_DATE" \
-d "subscription[pause_date]"=1566698400
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebl8Oi/pause_subscription_estimate \
-u {site_api_key}:\
-d pause_option="SPECIFIC_DATE" \
-d "subscription[pause_date]"=1566698400
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492963,
"credit_note_estimates": [],
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOcebl8Oi",
"next_billing_at": 1519912163,
"object": "subscription_estimate",
"pause_date": 1566698400,
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/pause_subscription_estimate
optional, enumerated string List of options to pause the subscription. Possible values are
immediatelyPause immediatelyend_of_termPause at the end of current termspecific_datePause on a specific datebilling_cyclesPause at the end of the current term, and resume automatically after the number of billing cycles you specify in skip_billing_cycles
immediatelyPause immediatelyend_of_termPause at the end of current termspecific_datePause on a specific datebilling_cyclesPause at the end of the current term, and resume automatically after the number of billing cycles you specify in skip_billing_cycles
Show all values[+] unbilled_charges_handling[]
optional, enumerated string Applicable when unbilled charges are present for the subscription and pause_option
is set as immediately
. Note: On the invoice raised, an automatic charge is attempted on the payment method available, if customer's auto-collection property is set to on
.
Possible values are
no_actionRetain as unbilled
If no_action
is chosen, charges are added to the resumption invoice.
invoiceInvoice charges
If invoice
is chosen, an automatic charge is attempted on the payment method available if the customer has enabled auto-collection. If a payment collection fails or when auto-collection is not enabled, the invoice is closed as unpaid.
no_actionRetain as unbilled
If no_action
is chosen, charges are added to the resumption invoice.
invoiceInvoice charges
If invoice
is chosen, an automatic charge is attempted on the payment method available if the customer has enabled auto-collection. If a payment collection fails or when auto-collection is not enabled, the invoice is closed as unpaid.
Show all values[+] subscription[[0..n]][0..n]
optional, timestamp(UTC) in seconds Parameters for subscription
Parameters for subscription
pass parameters as subscription[<param name>]
optional, timestamp(UTC) in seconds When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the paused
state, it is the date/time when the subscription was paused. subscription[resume_date] optional, timestamp(UTC) in seconds For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned. subscription[skip_billing_cycles] optional, integer, min=1 Number of billing cycles this subscription should be paused. The subscription resumes after the paused billing cycles end.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Generates an estimate for the 'resume subscription' operation. This is similar to the Resume a subscription API, but the subscription will not be resumed. Only an estimate for this operation is created.
In the response,
- estimate.subscription_estimate has the subscription details.
- estimate.invoice_estimate has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen for in-term resumption++.
++What is an "in-term resumption"?
An “in-term resumption” is when the resumption happens within the billing term of the subscription.
- estimate.next_invoice_estimate has details of the invoice that will be generated during the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation (scenario mentioned above) and this subscription has next billing.
The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebwWOw/resume_subscription_estimate \
-u {site_api_key}:\
-d resume_option="IMMEDIATELY"
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebwWOw/resume_subscription_estimate \
-u {site_api_key}:\
-d resume_option="IMMEDIATELY"
curl https://{site}.chargebee.com/api/v2/subscriptions/__test__8asyKSOcebwWOw/resume_subscription_estimate \
-u {site_api_key}:\
-d resume_option="IMMEDIATELY"
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492964,
"next_invoice_estimate": {
"amount_due": 2000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOcebrPOp",
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 1000,
"customer_id": "__test__8asyKSOcebrPOp",
"date_from": 1517492964,
"date_to": 1519912164,
"description": "basic USD",
"discount_amount": 0,
"entity_id": "basic-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOcebyEOy",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 1,
"subscription_id": "__test__8asyKSOcebwWOw",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 2000,
"taxes": [],
"total": 2000
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOcebwWOw",
"next_billing_at": 1519912164,
"object": "subscription_estimate",
"status": "active"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/subscriptions/{subscription-id}/resume_subscription_estimate
optional, enumerated string List of options to resume the subscription. Possible values are
immediatelyResume immediatelyspecific_dateResume on a specific date
optional, enumerated string Applicable when charges get added during this operation and resume_option is set as 'immediately'. Allows to raise invoice immediately or add them to unbilled charges. Possible values are
invoice_immediatelyInvoice immediatelyadd_to_unbilled_chargesAdd to unbilled charges
invoice_immediatelyInvoice immediatelyadd_to_unbilled_chargesAdd to unbilled charges
Show all values[+] subscription[[0..n]][0..n]
optional, timestamp(UTC) in seconds Parameters for subscription
Parameters for subscription
pass parameters as subscription[<param name>]
subscription[resume_date] optional, timestamp(UTC) in seconds For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
This endpoint generates an estimate for a subscription that is intended to be a gift. The estimate provides details about the gift sender, gift recipient, address details of the recipient, and the type and details of subscription items included in the gift.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/estimates/gift_subscription_for_items \
-u {site_api_key}:\
-d "gift[scheduled_at]"=1601106050 \
-d "gifter[customer_id]"="gifter" \
-d "gifter[signature]"="Sam" \
-d "gift_receiver[customer_id]"="receiver" \
-d "gift_receiver[first_name]"="James" \
-d "gift_receiver[last_name]"="William" \
-d "gift_receiver[email]"="james@user.com" \
-d "subscription_items[item_price_id][0]"="gift-plan-USD" \
-d "subscription_items[quantity][0]"=2 \
-d "subscription_items[item_price_id][1]"="day-pass-USD"
curl https://{site}.chargebee.com/api/v2/estimates/gift_subscription_for_items \
-u {site_api_key}:\
-d "gift[scheduled_at]"=1601106050 \
-d "gifter[customer_id]"="gifter" \
-d "gifter[signature]"="Sam" \
-d "gift_receiver[customer_id]"="receiver" \
-d "gift_receiver[first_name]"="James" \
-d "gift_receiver[last_name]"="William" \
-d "gift_receiver[email]"="james@user.com" \
-d "subscription_items[item_price_id][0]"="gift-plan-USD" \
-d "subscription_items[quantity][0]"=2 \
-d "subscription_items[item_price_id][1]"="day-pass-USD"
curl https://{site}.chargebee.com/api/v2/estimates/gift_subscription_for_items \
-u {site_api_key}:\
-d "gift[scheduled_at]"=1601106050 \
-d "gifter[customer_id]"="gifter" \
-d "gifter[signature]"="Sam" \
-d "gift_receiver[customer_id]"="receiver" \
-d "gift_receiver[first_name]"="James" \
-d "gift_receiver[last_name]"="William" \
-d "gift_receiver[email]"="james@user.com" \
-d "subscription_items[item_price_id][0]"="gift-plan-USD" \
-d "subscription_items[quantity][0]"=2 \
-d "subscription_items[item_price_id][1]"="day-pass-USD"
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1612964962,
"invoice_estimate": {
"amount_due": 2000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "gifter",
"date": 1612964962,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 2000,
"customer_id": "gifter",
"date_from": 1708177762,
"date_to": 1710683362,
"description": "Gift Plan USD",
"discount_amount": 0,
"entity_id": "gift-plan-USD",
"entity_type": "plan_item_price",
"id": "li___test__8asyKSOcebcQOY",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "per_unit",
"quantity": 2,
"subscription_id": "__test__8asyKSOcebZjOW",
"tax_amount": 0,
"unit_amount": 1000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": true,
"round_off_amount": 0,
"sub_total": 2000,
"taxes": [],
"total": 2000
},
"object": "estimate",
"subscription_estimate": {
"currency_code": "USD",
"id": "__test__8asyKSOcebZjOW",
"object": "subscription_estimate",
"status": "future"
}
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/estimates/gift_subscription_for_items
optional, list of string List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
optional, timestamp(UTC) in seconds Parameters for gift
optional, string Parameters for gifter gift_receiver[[0..n]][0..n]
optional, string Parameters for gift_receiver payment_intent[[0..n]][0..n]
optional, string Parameters for payment_intent shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address subscription_items[[0..n]][0..n]
optional, array Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
Parameters for gift
pass parameters as gift[<param name>]
optional, timestamp(UTC) in seconds Indicates the date on which the gift notification is sent to the receiver. If not passed, the receiver is notified immediately. optional, boolean, default=false When true
, the claim happens automatically. When not passed, the default value in the site settings is used. optional, boolean When true
, indicates that the gift does not expire. Do not pass or pass as false
when auto_claim
is set.
optional, timestamp(UTC) in seconds The date until which the gift can be claimed. Must be set to a value after scheduled_at
. If the gift is not claimed within claim_expiry_date
, it will expire and the subscription will move to cancelled
state. When not passed, the value specified in the site settings will be used.
Pass as NULL
or do not pass when auto_claim
or no_expiry
are set.
Parameters for gifter
pass parameters as gifter[<param name>]
required, string, max chars=50 Gifter customer id. required, string, max chars=50 Gifter sign-off name optional, string, max chars=500 Personalized message for the gift. optional, string, max chars=40 Identifier of the payment source
Parameters for gift_receiver
pass parameters as gift_receiver[<param name>]
gift_receiver[customer_id] required, string, max chars=50 Receiver customer id. gift_receiver[first_name] required, string, max chars=150 First name of the receiver as given by the gifter. required, string, max chars=150 Last name of the receiver as given by the gifter, required, string, max chars=70 Email of the receiver. All gift related emails are sent to this email.
Parameters for payment_intent
pass parameters as payment_intent[<param name>]
optional, string, max chars=150 Identifier for PaymentIntent generated by Chargebee.js. Applicable only when you are using Chargebee.js for completing the 3DS flow. The PaymentIntent should be in 'authorized' state while passing it here. You need not pass other PaymentIntent parameters if this is passed. payment_intent[gateway_account_id] required if payment intent token provided, string, max chars=50 The gateway account used for performing the 3DS flow. optional, string, max chars=65k Identifier for 3DS transaction/verification object at the gateway. Can be passed only after successfully completing the 3DS flow. Refer 3DS implementation in Chargebee to find out the gateway-specific gw_token format. Applicable when you are using gateway APIs directly for completing the 3DS flow. payment_intent[payment_method_type] optional, enumerated string The list of payment method types (For example, card, ideal, sofort, bancontact, etc.) this Payment Intent is allowed to use. If payment method type is empty, Card is taken as the default type for all gateways except Razorpay. Possible values are
cardcardidealidealsofortsofortbancontactbancontactgoogle_paygoogle_paydotpaydotpaygiropaygiropayapple_payapple_payupiupinetbanking_emandatesnetbanking_emandatespaypal_express_checkoutpaypal_express_checkoutdirect_debitdirect_debitboletoboletovenmoVenmo amazon_paymentsAmazon Paymentspay_toPayTo faster_paymentsFaster Payments sepa_instant_transferSepa Instant Transfer klarna_pay_nowKlarna Pay Now online_banking_polandOnline Banking Poland
cardcardidealidealsofortsofortbancontactbancontact
google_paygoogle_paydotpaydotpaygiropaygiropayapple_payapple_payupiupinetbanking_emandatesnetbanking_emandatespaypal_express_checkoutpaypal_express_checkoutdirect_debitdirect_debitboletoboletovenmoVenmo amazon_paymentsAmazon Paymentspay_toPayTo faster_paymentsFaster Payments sepa_instant_transferSepa Instant Transfer klarna_pay_nowKlarna Pay Now online_banking_polandOnline Banking Poland
Show all values[+] payment_intent[reference_id] optional, string, max chars=65k Identifier for Braintree permanent token. Applicable when you are using Braintree APIs for completing the 3DS flow. payment_intent[additional_information] optional, jsonobject checkout_com
: While adding a new payment method using permanent token or passing raw card details to Checkout.com, document
ID and country_of_residence
are required to support payments through dLocal.payer
: User related information.country_of_residence
: This is required since the billing country associated with the user’s payment method may not be the same as their country of residence. Hence the user’s country of residence needs to be specified. The country code should be a two-character ISO code.document
: Document ID is the user’s identification number based on their country.
bluesnap
: While passing raw card details to BlueSnap, if fraud_session_id
is added, additional validation is performed to avoid fraudulent transactions.fraud
: Fraud identification related information.
braintree
: While passing raw card details to Braintree, your fraud_merchant_id
and the user’s device_session_id
can be added to perform additional validation and avoid fraudulent transactions.fraud
: Fraud identification related information.device_session_id
: Session ID associated with the user's device.fraud_merchant_id
: Your merchant ID for fraud detection.
chargebee_payments
: While passing raw card details to Chargebee Payments, if fraud_session_id
is added, additional validation is performed to avoid fraudulent transactions.fraud
: Fraud identification related information.fraud_session_id
: Your Chargebee Payments fraud session ID required to perform anti-fraud validation.
bank_of_america
: While passing raw card details to Bank of America, your user’s device_session_id
can be added to perform additional validation and avoid fraudulent transactions.fraud
: Fraud identification related information.device_session_id
: Session ID associated with the user's device.
ecentric
: This parameter is used to verify and process payment method details in Ecentric. If the merchant_id
parameter is included, Chargebee will vault it / perform a lookup and verification against this merchant_id
, overriding the one configured in Chargebee. If tokens and processing occur in the same Merchant GUID, you can just skip this part. merchant_id
: Merchant GUID where the card is vaulted or need to be vaulted.
ebanx
: While passing raw card details to EBANX, the user's document
is required for some countries and device_session_id
can be added to perform additional validation and avoid fraudulent transactions. -
payer
: User related information. -
document
: Document is the user's identification number based on their country.
-
fraud
: Fraud identification related information. -
device_session_id
: Session ID associated with the user's device
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name] optional, string, max chars=150 The first name of the contact. shipping_address[last_name] optional, string, max chars=150 The last name of the contact. optional, string, max chars=70 The email address. shipping_address[company] optional, string, max chars=250 The company name. optional, string, max chars=50 The phone number. optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. shipping_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=50 The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided. optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. shipping_address[country] optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
shipping_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for subscription_items. Multiple subscription_items can be passed by specifying unique indices.
pass parameters as subscription_items[<param name>][<idx:0..n>]
subscription_items[item_price_id][0..n] optional, string, max chars=100 The unique identifier of the item price. subscription_items[quantity][0..n] optional, integer, default=1, min=1 The quantity of the item purchased subscription_items[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
This endpoint creates an invoice estimate for non-recurring items.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/estimates/create_invoice_for_items \
-u {site_api_key}:\
-d "invoice[customer_id]"="__test__KyVkjTS2onpk57" \
-d "item_prices[item_price_id][0]"="ssl-charge-USD" \
-d "item_prices[unit_price][0]"=2000 \
-d "charges[amount][0]"=1000 \
-d "charges[description][0]"="Adhoc charge"
curl https://{site}.chargebee.com/api/v2/estimates/create_invoice_for_items \
-u {site_api_key}:\
-d "invoice[customer_id]"="__test__KyVkjTS2onpk57" \
-d "item_prices[item_price_id][0]"="ssl-charge-USD" \
-d "item_prices[unit_price][0]"=2000 \
-d "charges[amount][0]"=1000 \
-d "charges[description][0]"="Adhoc charge"
curl https://{site}.chargebee.com/api/v2/estimates/create_invoice_for_items \
-u {site_api_key}:\
-d "invoice[customer_id]"="__test__KyVkjTS2onpk57" \
-d "item_prices[item_price_id][0]"="ssl-charge-USD" \
-d "item_prices[unit_price][0]"=2000 \
-d "charges[amount][0]"=1000 \
-d "charges[description][0]"="Adhoc charge"
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1517492957,
"invoice_estimate": {
"amount_due": 3000,
"amount_paid": 0,
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "__test__8asyKSOcea8tNt",
"date": 1517492957,
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 2000,
"customer_id": "__test__8asyKSOcea8tNt",
"date_from": 1517492957,
"date_to": 1517492957,
"description": "SSL Charge USD Monthly",
"discount_amount": 0,
"entity_id": "ssl-charge-USD",
"entity_type": "charge_item_price",
"id": "li___test__8asyKSOceaEYNx",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "flat_fee",
"quantity": 1,
"tax_amount": 0,
"unit_amount": 2000
},
{..}
],
"object": "invoice_estimate",
"price_type": "tax_exclusive",
"recurring": false,
"round_off_amount": 0,
"sub_total": 3000,
"taxes": [],
"total": 3000
},
"object": "estimate"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/estimates/create_invoice_for_items
required if Multicurrency is enabled, string, max chars=3 The currency code (ISO 4217 format) of the invoice amount.
optional, string, max chars=2000 A note for this particular invoice. This, and all other notes for the invoice are displayed on the PDF invoice sent to the customer.
optional, boolean, default=false Set as true
to remove the general note from this invoice.
optional, list of string List of Coupons to be added. authorization_transaction_id[]
optional, string, max chars=40 Authorization transaction to be captured.
optional, string, max chars=40 Payment source to be used for this payment.
optional, enumerated string The customer level auto collection will be override if specified. Possible values are
onWhenever an invoice is created, an automatic attempt will be made to charge.offWhenever an invoice is created as payment due.
onWhenever an invoice is created, an automatic attempt will be made to charge.offWhenever an invoice is created as payment due.
Show all values[+]
optional, timestamp(UTC) in seconds The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date.
taxes
and
line_item_taxes
are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
optional, string Parameters for invoice shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address billing_address[[0..n]][0..n]
optional, string Parameters for billing_address item_prices[[0..n]][0..n]
optional, array Parameters for item_prices. Multiple item_prices can be passed by specifying unique indices.
optional, array Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
optional, array Parameters for charges. Multiple charges can be passed by specifying unique indices. notes_to_remove[[0..n]][0..n]
optional, array Parameters for notes_to_remove. Multiple notes_to_remove can be passed by specifying unique indices.
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices. tax_providers_fields[[0..n]][0..n]
optional, array Parameters for tax_providers_fields. Multiple tax_providers_fields can be passed by specifying unique indices.
Parameters for invoice
pass parameters as invoice[<param name>]
optional, string, max chars=50 Identifier of the customer for which this invoice needs to be created. optional, string, max chars=50 Identifier of the subscription for which this invoice needs to be created. Should be specified if 'customer_id' is not specified.(not applicable for consolidated invoice) optional, string, max chars=100 Purchase Order Number for this invoice.
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name] optional, string, max chars=150 The first name of the contact. shipping_address[last_name] optional, string, max chars=150 The last name of the contact. optional, string, max chars=70 The email address. shipping_address[company] optional, string, max chars=250 The company name. optional, string, max chars=50 The phone number. optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. shipping_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=50 The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided. optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. shipping_address[country] optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
shipping_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for billing_address
pass parameters as billing_address[<param name>]
optional, string, max chars=150 Address line 1 optional, string, max chars=150 Address line 2 optional, string, max chars=150 Address line 3 optional, string, max chars=50 The name of the city. billing_address[state_code] optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
). optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here. optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI
(the code for United Kingdom – Northern Ireland) is available as an option.
billing_address[validation_status] optional, enumerated string, default=not_validated The address verification status. Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
Parameters for item_prices. Multiple item_prices can be passed by specifying unique indices.
pass parameters as item_prices[<param name>][<idx:0..n>]
item_prices[item_price_id][0..n] optional, string, max chars=100 A unique ID for your system to identify the item price. item_prices[quantity][0..n] optional, integer, min=1 Item price quantity item_prices[quantity_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. item_prices[unit_price][0..n] optional, in cents, min=0 The price or per-unit-price of the item price. By default, it is the value set for the item_price
. This is only applicable when the pricing_model
of the item_price
is flat_fee
or per_unit
. The value depends on the type of currency. item_prices[unit_price_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when multi-decimal pricing is enabled. item_prices[date_from][0..n] optional, timestamp(UTC) in seconds The time when the service period for the item starts. item_prices[date_to][0..n] optional, timestamp(UTC) in seconds The time when the service period for the item ends.
Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
pass parameters as item_tiers[<param name>][<idx:0..n>]
item_tiers[item_price_id][0..n] optional, string, max chars=100 The id of the item price to which this tier belongs. item_tiers[starting_unit][0..n] optional, integer, min=1 The lowest value in the quantity tier. item_tiers[ending_unit][0..n] optional, integer The highest value in the quantity tier. optional, in cents, default=0, min=0 The per-unit price for the tier when the pricing_model
is tiered
or volume
. The total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency. item_tiers[starting_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[ending_unit_in_decimal][0..n] optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. item_tiers[price_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the per-unit price for the tier when the pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled. item_tiers[pricing_type][0..n] optional, enumerated string Pricing type for the tier. Possible values are
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
per_unitIndicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).flat_feeIndicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
Show all values[+] item_tiers[package_size][0..n] optional, integer, min=1 Package size for the tier when pricing type is package
. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
Parameters for charges. Multiple charges can be passed by specifying unique indices.
pass parameters as charges[<param name>][<idx:0..n>]
charges[discount_amount][0..n] optional, in cents, min=0 The value of the discount. The format of this value depends on the kind of currency. Either this parameter or charges[discount_percentage]
should be passed. charges[discount_percentage][0..n] optional, double, min=0.01, max=100.0 The percentage of the original amount that should be deducted from it. Either this parameter or charges[discount_amount]
should be passed. optional, in cents, min=1 The amount to be charged. The unit depends on the type of currency. charges[amount_in_decimal][0..n] optional, string, max chars=39 The decimal representation of the amount for the one-time charge. Provide the value in major units of the currency. Can be provided only when multi-decimal pricing is enabled. charges[description][0..n] optional, string, max chars=250 Description for this charge optional, boolean, default=true The amount to be charged is taxable or not. charges[tax_profile_id][0..n] optional, string, max chars=50 Tax profile of the charge. charges[avalara_tax_code][0..n] 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. 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:
charges[taxjar_product_code][0..n] 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. charges[avalara_sale_type][0..n] optional, enumerated string Indicates the type of sale carried out. This is applicable only if you use Chargebee’s AvaTax for Communications integration. Possible values are
wholesaleTransaction is a sale to another company that will resell your product or service to another consumerretailTransaction is a sale to an end userconsumedTransaction is for an item that is consumed directlyvendor_useTransaction is for an item that is subject to vendor use tax
wholesaleTransaction is a sale to another company that will resell your product or service to another consumerretailTransaction is a sale to an end userconsumedTransaction is for an item that is consumed directlyvendor_useTransaction is for an item that is subject to vendor use tax
Show all values[+] charges[avalara_transaction_type][0..n] 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. charges[avalara_service_type][0..n] 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. optional, timestamp(UTC) in seconds The time when the service period for the charge starts. optional, timestamp(UTC) in seconds The time when the service period for the charge ends.
Parameters for notes_to_remove. Multiple notes_to_remove can be passed by specifying unique indices.
pass parameters as notes_to_remove[<param name>][<idx:0..n>]
notes_to_remove[entity_type][0..n] optional, enumerated string Type of entity to which the note belongs. To remove the general note, use the remove_general_note
parameter. Possible values are
customerEntity that represents a customer.subscriptionEntity that represents a subscription of customer.couponEntity that represents a coupon.plan_item_priceIndicates that this line item is based on plan Item Priceaddon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
customerEntity that represents a customer.subscriptionEntity that represents a subscription of customer.couponEntity that represents a coupon.plan_item_priceIndicates that this line item is based on plan Item Price
addon_item_priceIndicates that this line item is based on addon Item Pricecharge_item_priceIndicates that this line item is based on charge Item Price
Show all values[+] notes_to_remove[entity_id][0..n] optional, string, max chars=100 Unique identifier of the note.
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]
discounts[percentage][0..n] optional, double, min=0.01, max=100.0 The percentage of the original amount that should be deducted from it. discounts[apply_on][0..n] required, enumerated string The amount on the invoice to which the discount is applied. Possible values are
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
Show all values[+] discounts[item_price_id][0..n] optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on
= specific_item_price
.
Parameters for tax_providers_fields. Multiple tax_providers_fields can be passed by specifying unique indices.
pass parameters as tax_providers_fields[<param name>][<idx:0..n>]
tax_providers_fields[provider_name][0..n] optional, string, max chars=50 Name of the tax provider. tax_providers_fields[field_id][0..n] optional, string, max chars=50 Field id of the attribute which tax vendor has provided while getting onboarded with Chargebee. tax_providers_fields[field_value][0..n] optional, string, max chars=50 The value of the related tax field
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x
Generates an estimate without creating a payment schedule. This endpoint can be called when you want to preview details of a new payment schedule before actually creating one.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/estimates/payment_schedules \
-u {site_api_key}:\
-d scheme_id="scheme1" \
-d invoice_id="cbdemo_inv_003" \
-d amount=100000 \
-d payment_schedule_start_date=1707302531
curl https://{site}.chargebee.com/api/v2/estimates/payment_schedules \
-u {site_api_key}:\
-d scheme_id="scheme1" \
-d invoice_id="cbdemo_inv_003" \
-d amount=100000 \
-d payment_schedule_start_date=1707302531
curl https://{site}.chargebee.com/api/v2/estimates/payment_schedules \
-u {site_api_key}:\
-d scheme_id="scheme1" \
-d invoice_id="cbdemo_inv_003" \
-d amount=100000 \
-d payment_schedule_start_date=1707302531
Sample Response [ JSON ]
Show more...
{
"estimate": {
"created_at": 1707302531,
"payment_schedule_estimates": [
{
"id": "__dev__Hw7wpIzUKlI7yLl",
"entity_type": "invoice",
"entity_id": "cbdemo_inv_003",
"scheme_id": "scheme1",
"currency_code": "USD",
"object": "payment_schedule_estimate",
"schedule_entries": [
{
"id": "__dev__Hw7wpIzUKlI7yWm",
"date": 1707302531,
"amount": 33333,
"status": "posted",
"object": "schedule_entry"
},
{..}
]
},
{..}
]
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/estimates/payment_schedules
required, string The unique identifier for the payment_schedule_scheme
. This identifier is used to retrieve the payment schedule scheme, which is then applied to calculate the amount and date for the specified number of payment schedules.
optional, in cents, min=0 Defines the payment schedule amount set for an invoice. If this is not provided, the total invoice.amount_due
is used. This value is mandatory in case invoice_id
is not provided.
optional, string Unique identifier of the invoice. payment_schedule_start_date[]
optional, timestamp(UTC) in seconds The date from which the payment schedule will start. This is applicable only when invoice_id is not provided. If invoice_id
is provided, we will consider invoice.due_date
.
always returned required
Resource object representing estimate
Sample admin console URL
https://{site}.chargebee.com/admin-console/estimates/123x