'Estimates', as the name implies, can be used to find out the estimate for performing an operation as against performing the operation itself. Say, if you want to create a new subscription or update an existing one, you can deduce the details such as the amount the customer needs to be charged for this operation, the state the subscription would be in, etc. using the estimate API.

Note:

  • These APIs when invoked don't perform actual operations. They just generate an estimate.
  • If you have configured Avalara, Chargebee will retrieve tax amount from Avalara to be displayed in the estimate invoice, this may increase your Avalara request count.

Sample estimate [ JSON ]

{ "created_at": 1517469195, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkAU5yP", "date": 1517469195, "line_item_discounts": [], "line_item_taxes": [], "line_items": [{ "amount": 895, "customer_id": "__test__KyVnJjRnFYkAU5yP", "date_from": 1517469195, "date_to": 1519888395, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkB05yR", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "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", "next_billing_at": 1519888395, "object": "subscription_estimate", "status": "active" } }
created_at
The time at which this estimate got generated.
timestamp(UTC) in seconds
Represents the subscription details when the 'estimate' operations are invoked.
optional, subscription_estimate
Represents the preview of the invoice generated immediately when the 'estimate' operations are invoked.
optional, 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 invoice_estimate
Represents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
optional, invoice_estimate
Represents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.
optional, list of credit_note_estimate
Represents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the ‘Subscription renewal estimate’ operation.
optional, list of unbilled_charge
id
The identifier of the subscription.
optional, string, max chars=50
currency_code
The currency code (ISO 4217 format) of the subscription.
string, max chars=3
status
The status of the subscription.
optional, enumerated string
Possible values are
futureThe Subscription is scheduled to start in a future date.in_trialThe subscription is in trial.activeThe subscription is in active state and will be charged at start of each term based on the recurring items(plan & addons etc.,).non_renewingThe subscription will be cancelled at end of the current term.pausedThe subscription is paused. No new recurring actions will be allowed, but any pending payments will be collected.cancelledThe subscription has been cancelled. No new recurring actions will take place, but any pending payments will be collected.
next_billing_at
Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.
optional, timestamp(UTC) in seconds
pause_date
The date at which subscription will be paused. Applicable only for paused or schedule pause subscription.
optional, timestamp(UTC) in seconds
resume_date
The date at which subscription will be resumed. Applicable only for paused or schedule pause subscription.
optional, timestamp(UTC) in seconds
shipping_address
Show attributes[+]
Represents the shipping address when the 'estimate' operations are invoked.
optional, shipping_address
Shipping addres attributes
first_name
First name.
optional, string, max chars=150
last_name
Last name.
optional, string, max chars=150
email
Email.
optional, string, max chars=70
company
Company name.
optional, string, max chars=250
phone
Phone number.
optional, string, max chars=50
line1
Address line 1.
optional, string, max chars=180
line2
Address line 2.
optional, string, max chars=150
line3
Address line 3.
optional, string, max chars=150
city
City.
optional, string, max chars=50
state_code
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
optional, string, max chars=50
state
The state/province name.
optional, string, max chars=50
country
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
zip
Zip or Postal code.
optional, string, max chars=20
validation_status
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
contract_term
Show attributes[+]
Represents the contract terms when the 'estimate' operations are invoked.
optional, contract_term
Contract term attributes
id
Id that uniquely identifies the contract term in the site.
string, max chars=50
status
Current status of contract.
enumerated string
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.
contract_start
The start date of the contract term.
timestamp(UTC) in seconds
contract_end
The end date of the contract term.
timestamp(UTC) in seconds
billing_cycle
The number of billing cycles of the subscription that the contract term is for.
integer, min=0
action_at_term_end
Action to be taken when the contract term completes.
enumerated string, default=renew
Possible values are
renew
  • 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 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.
  • .
    total_contract_value
    The sum of the totals of all the invoices raised as part of the contract term. For active contract terms, this includes the invoices raised thus far and estimated invoice totals till the end of the contract term. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised.
    in cents, default=0, min=0
    cancellation_cutoff_period
    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.
    optional, integer
    created_at
    The date when the contract term was created.
    timestamp(UTC) in seconds
    subscription_id
    The Id of the subscription that this contract term is for.
    string, max chars=50
    remaining_billing_cycles
    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, integer, min=0
    recurring
    Will be 'true' for subscription related estimates.
    boolean, default=true
    price_type
    The price type of this invoice.
    enumerated string, default=tax_exclusive
    Possible values are
    tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
    currency_code
    The currency code (ISO 4217 format) of the invoice.
    string, max chars=3
    sub_total
    Invoice sub-total in cents.
    in cents, min=0
    total
    Invoice total in cents.
    optional, in cents, default=0, min=0
    credits_applied
    credits applied to this invoice in cents.
    optional, in cents, default=0, min=0
    amount_paid
    Existing outstanding payments if any, applied to this invoice in cents.
    optional, in cents, default=0, min=0
    amount_due
    Invoice amount due in cents.
    optional, in cents, default=0, min=0
    round_off_amount
    Indicates the rounded-off amount.
    optional, in cents, min=0
    customer_id
    A unique identifier for the customer this invoice belongs to.
    optional, string, max chars=100
    line_items
    Show attributes[+]
    The list of items in this estimate.
    optional, list of line_item
    Line item attributes
    id
    Uniquely identifies a line_item.
    optional, string, max chars=40
    subscription_id
    A unique identifier for the subscription this lineitem belongs to.
    optional, string, max chars=3
    date_from
    Start date of this lineitem.
    timestamp(UTC) in seconds
    date_to
    End date of this lineitem.
    timestamp(UTC) in seconds
    unit_amount
    Unit amount of the lineitem.
    in cents
    quantity
    Quantity of the recurring item which is represented by this lineitem.
    optional, integer, default=1
    amount
    Total amount of this lineitem. Typically equals to unit amount x quantity.
    optional, in cents
    pricing_model
    Charges a single price for the plan/addon.
    optional, enumerated string
    Possible values are
    flat_feeCharge a single price on recurring basis.per_unitCharge the price for each unit of the plan for the subscription on recurring basis.tieredCharges a different per unit price for the quantity purchased from every tier.volumeCharges the per unit price for the total quantity purchased based on the tier under which it falls.stairstepCharges a price for a range.
    is_taxed
    Specifies whether this line item is taxed or not.
    boolean, default=false
    tax_amount
    The tax amount charged for this item.
    optional, in cents, default=0, min=0
    tax_rate
    Rate of tax used to calculate tax for this lineitem.
    optional, double, min=0.0, max=100.0
    discount_amount
    Total discounts for this line.
    optional, in cents, min=0
    item_level_discount_amount
    'Item' level discounts for this line.
    optional, in cents, min=0
    description
    Detailed description about this lineitem.
    string, max chars=250
    entity_description
    Detailed description about this item.
    string, max chars=500
    entity_type
    Specifies the modelled entity (plan / addon etc) this lineitem is based on.
    enumerated string
    Possible values are
    plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan id.planIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan id.addonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon id.adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case.
    tax_exempt_reason
    The reason or category due to which the line item price/amount is excluded from taxable amount.
    optional, enumerated string
    Possible values are
    tax_not_configuredIf tax is not enabled for the site.region_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 jurisdiction.exportIf the Merchant is not registered for Tax in this region, taxes will not be applied.customer_exemptIf the Customer is marked as Tax exempt.product_exemptIf the Plan or Addon is marked as Tax exempt.zero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line item.reverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only.high_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 applied.
    entity_id
    The identifier of the modelled entity this lineitem is based on. Will be null for 'adhoc' entity type.
    optional, string, max chars=100
    customer_id
    A unique identifier for the customer this lineitem belongs to.
    optional, string, max chars=100
    discounts
    Show attributes[+]
    The list of discounts applied to this estimate.
    optional, list of discount
    Discount attributes
    amount
    Discount amount.
    in cents, min=0
    description
    Detailed description of this discount line item.
    optional, string, max chars=250
    entity_type
    Type of this Discount lineitem.
    enumerated string
    Possible values are
    item_level_couponRepresents the 'Item' level coupons applied to this invoice. Further the 'entity_id' attribute specifies the coupon id this discount is based on.document_level_couponRepresents the 'Document' level coupons applied to this document. Further the 'entity_id' attribute specifies the coupon id this discount is based on.promotional_creditsRepresents the Promotional Credits item in invoice. The 'entity_id' attribute will be null in this case.prorated_creditsRepresents the credit adjustment items in invoice. The 'entity_id' attribute will be null in this case.
    entity_id
    The identifier of the modelled entity this lineitem is bases on. Will be null for 'Prorated Credits' & 'Promotional Credits'.
    optional, string, max chars=100
    The list of taxes applied to this estimate.
    optional, list of tax
    Tax attributes
    name
    The name of the tax applied. E.g. GST.
    string, max chars=100
    amount
    The tax amount.
    in cents, min=0
    description
    Description of the tax item.
    optional, string, max chars=250
    line_item_taxes
    Show attributes[+]
    The list of taxes applied on line items.
    optional, list of line_item_tax
    Line item tax attributes
    line_item_id
    The unique reference id of the line item for which the tax is applicable.
    optional, string, max chars=40
    tax_name
    The name of the tax applied.
    string, max chars=100
    tax_rate
    The rate of tax used to calculate tax amount.
    double, default=0.0, min=0.0, max=100.0
    is_partial_tax_applied
    Indicates if tax is applied only on a portion of the line item amount.
    optional, boolean
    is_non_compliance_tax
    Indicates the non-compliance tax that should not be reported to the jurisdiction.
    optional, boolean
    taxable_amount
    Indicates the actual portion of the line item amount that is taxable.
    in cents, min=0
    tax_amount
    The tax amount.
    in cents, min=0
    tax_juris_type
    The type of tax jurisdiction.
    optional, enumerated string
    Possible values are
    countryThe tax jurisdiction is a country.federalThe tax jurisdiction is a federal.stateThe tax jurisdiction is a state.countyThe tax jurisdiction is a county.cityThe tax jurisdiction is a city.specialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
    tax_juris_name
    The name of the tax jurisdiction.
    optional, string, max chars=250
    tax_juris_code
    The tax jurisdiction code.
    optional, string, max chars=250
    tax_amount_in_local_currency
    Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
    optional, in cents, min=0
    local_currency_code
    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, string, max chars=null
    line_item_tiers
    Show attributes[+]
    The list of tiers applicable for this line item.
    optional, list of line_item_tier
    Line item tier attributes
    line_item_id
    Uniquely identifies a line_item.
    optional, string, max chars=40
    starting_unit
    The lower limit of a range of units for the tier.
    integer, min=1
    ending_unit
    The upper limit of a range of units for the tier.
    optional, integer
    quantity_used
    The number of units purchased in a range.
    integer, min=1
    unit_amount
    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.
    in cents, min=0
    line_item_discounts
    Show attributes[+]
    The list of discount(s) applied for each line item of this invoice.
    optional, list of line_item_discount
    Line item discount attributes
    line_item_id
    The unique reference id of the line item for which the discount is applicable.
    string, max chars=50
    discount_type
    Type of this discount line item.
    enumerated string
    Possible values are
    item_level_couponRepresents the 'Item' level coupons applied to this invoice. Further the 'coupon_id' attribute specifies the coupon id this discount is based on.document_level_couponRepresents the 'Document' level coupons applied to this document. Further the 'coupon_id' attribute specifies the coupon id this discount is based on.promotional_creditsRepresents the Promotional Credits item in invoice. The 'coupon_id' attribute will be null in this case.prorated_creditsRepresents the credit adjustment items in invoice. The 'coupon_id' attribute will be null in this case.
    coupon_id
    Coupon id.
    optional, string, max chars=50
    discount_amount
    Discount amount.
    in cents, min=0
    reference_invoice_id
    The reference invoice id.
    string, max chars=50
    type
    credit note type.
    enumerated string
    Possible values are
    adjustmentAdjustment Credit Note.refundableRefundable Credit Note.
    price_type
    The price type of this credit note.
    enumerated string, default=tax_exclusive
    Possible values are
    tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
    currency_code
    The currency code (ISO 4217 format) of the credit note.
    string, max chars=3
    sub_total
    Invoice sub-total in cents.
    in cents, min=0
    total
    CreditNote total in cents.
    in cents, min=0
    amount_allocated
    Allocated credits in cents.
    in cents, min=0
    amount_available
    Remaining credits in cents.
    in cents, min=0
    round_off_amount
    Indicates the rounded-off amount.
    optional, in cents, min=0
    customer_id
    A unique identifier for the customer this credit note belongs to.
    optional, string, max chars=100
    line_items
    Show attributes[+]
    The list of items in this estimate.
    optional, list of line_item
    Line item attributes
    id
    Uniquely identifies a line_item.
    optional, string, max chars=40
    subscription_id
    A unique identifier for the subscription this lineitem belongs to.
    optional, string, max chars=3
    date_from
    Start date of this lineitem.
    timestamp(UTC) in seconds
    date_to
    End date of this lineitem.
    timestamp(UTC) in seconds
    unit_amount
    Unit amount of the lineitem.
    in cents
    quantity
    Quantity of the recurring item which is represented by this lineitem.
    optional, integer, default=1
    amount
    Total amount of this lineitem. Typically equals to unit amount x quantity.
    optional, in cents
    pricing_model
    Charges a single price for the plan/addon.
    optional, enumerated string
    Possible values are
    flat_feeCharge a single price on recurring basis.per_unitCharge the price for each unit of the plan for the subscription on recurring basis.tieredCharges a different per unit price for the quantity purchased from every tier.volumeCharges the per unit price for the total quantity purchased based on the tier under which it falls.stairstepCharges a price for a range.
    is_taxed
    Specifies whether this line item is taxed or not.
    boolean, default=false
    tax_amount
    The tax amount charged for this item.
    optional, in cents, default=0, min=0
    tax_rate
    Rate of tax used to calculate tax for this lineitem.
    optional, double, min=0.0, max=100.0
    discount_amount
    Total discounts for this line.
    optional, in cents, min=0
    item_level_discount_amount
    'Item' level discounts for this line.
    optional, in cents, min=0
    description
    Detailed description about this lineitem.
    string, max chars=250
    entity_description
    Detailed description about this item.
    string, max chars=500
    entity_type
    Specifies the modelled entity (plan / addon etc) this lineitem is based on.
    enumerated string
    Possible values are
    plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan id.planIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan id.addonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon id.adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case.
    tax_exempt_reason
    The reason or category due to which the line item price/amount is excluded from taxable amount.
    optional, enumerated string
    Possible values are
    tax_not_configuredIf tax is not enabled for the site.region_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 jurisdiction.exportIf the Merchant is not registered for Tax in this region, taxes will not be applied.customer_exemptIf the Customer is marked as Tax exempt.product_exemptIf the Plan or Addon is marked as Tax exempt.zero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line item.reverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only.high_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 applied.
    entity_id
    The identifier of the modelled entity this lineitem is based on. Will be null for 'adhoc' entity type.
    optional, string, max chars=100
    customer_id
    A unique identifier for the customer this lineitem belongs to.
    optional, string, max chars=100
    discounts
    Show attributes[+]
    The list of discounts applied to this estimate.
    optional, list of discount
    Discount attributes
    amount
    Discount amount.
    in cents, min=0
    description
    Detailed description of this discount line item.
    optional, string, max chars=250
    entity_type
    Type of this Discount lineitem.
    enumerated string
    Possible values are
    item_level_couponRepresents the 'Item' level coupons applied to this invoice. Further the 'entity_id' attribute specifies the coupon id this discount is based on.document_level_couponRepresents the 'Document' level coupons applied to this document. Further the 'entity_id' attribute specifies the coupon id this discount is based on.promotional_creditsRepresents the Promotional Credits item in invoice. The 'entity_id' attribute will be null in this case.prorated_creditsRepresents the credit adjustment items in invoice. The 'entity_id' attribute will be null in this case.
    entity_id
    The identifier of the modelled entity this lineitem is bases on. Will be null for 'Prorated Credits' & 'Promotional Credits'.
    optional, string, max chars=100
    The list of taxes applied to this estimate.
    optional, list of tax
    Tax attributes
    name
    The name of the tax applied. E.g. GST.
    string, max chars=100
    amount
    The tax amount.
    in cents, min=0
    description
    Description of the tax item.
    optional, string, max chars=250
    line_item_taxes
    Show attributes[+]
    The list of taxes applied on line items.
    optional, list of line_item_tax
    Line item tax attributes
    line_item_id
    The unique reference id of the line item for which the tax is applicable.
    optional, string, max chars=40
    tax_name
    The name of the tax applied.
    string, max chars=100
    tax_rate
    The rate of tax used to calculate tax amount.
    double, default=0.0, min=0.0, max=100.0
    is_partial_tax_applied
    Indicates if tax is applied only on a portion of the line item amount.
    optional, boolean
    is_non_compliance_tax
    Indicates the non-compliance tax that should not be reported to the jurisdiction.
    optional, boolean
    taxable_amount
    Indicates the actual portion of the line item amount that is taxable.
    in cents, min=0
    tax_amount
    The tax amount.
    in cents, min=0
    tax_juris_type
    The type of tax jurisdiction.
    optional, enumerated string
    Possible values are
    countryThe tax jurisdiction is a country.federalThe tax jurisdiction is a federal.stateThe tax jurisdiction is a state.countyThe tax jurisdiction is a county.cityThe tax jurisdiction is a city.specialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
    tax_juris_name
    The name of the tax jurisdiction.
    optional, string, max chars=250
    tax_juris_code
    The tax jurisdiction code.
    optional, string, max chars=250
    tax_amount_in_local_currency
    Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
    optional, in cents, min=0
    local_currency_code
    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, string, max chars=null
    line_item_discounts
    Show attributes[+]
    The list of discount(s) applied for each line item of this invoice.
    optional, list of line_item_discount
    Line item discount attributes
    line_item_id
    The unique reference id of the line item for which the discount is applicable.
    string, max chars=50
    discount_type
    Type of this discount line item.
    enumerated string
    Possible values are
    item_level_couponRepresents the 'Item' level coupons applied to this invoice. Further the 'coupon_id' attribute specifies the coupon id this discount is based on.document_level_couponRepresents the 'Document' level coupons applied to this document. Further the 'coupon_id' attribute specifies the coupon id this discount is based on.promotional_creditsRepresents the Promotional Credits item in invoice. The 'coupon_id' attribute will be null in this case.prorated_creditsRepresents the credit adjustment items in invoice. The 'coupon_id' attribute will be null in this case.
    coupon_id
    Coupon id.
    optional, string, max chars=50
    discount_amount
    Discount amount.
    in cents, min=0
    line_item_tiers
    Show attributes[+]
    The list of tiers applicable for this line item.
    optional, list of line_item_tier
    Line item tier attributes
    line_item_id
    Uniquely identifies a line_item.
    optional, string, max chars=40
    starting_unit
    The lower limit of a range of units for the tier.
    integer, min=1
    ending_unit
    The upper limit of a range of units for the tier.
    optional, integer
    quantity_used
    The number of units purchased in a range.
    integer, min=1
    unit_amount
    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.
    in cents, min=0
    id
    Uniquely identifies an unbilled charge.
    optional, string, max chars=50
    customer_id
    A unique identifier for the customer being charged.
    optional, string, max chars=50
    subscription_id
    A unique identifier for the subscription this charge belongs to.
    optional, string, max chars=50
    date_from
    Start date of this charge.
    optional, timestamp(UTC) in seconds
    date_to
    Start date of this charge.
    optional, timestamp(UTC) in seconds
    unit_amount
    Unit amount of the charge item.
    optional, in cents, min=0
    pricing_model

    optional, enumerated string
    Possible values are
    flat_feeCharge a single price on recurring basis.per_unitCharge the price for each unit of the plan for the subscription on recurring basis.tieredCharges a different per unit price for the quantity purchased from every tier.volumeCharges the per unit price for the total quantity purchased based on the tier under which it falls.stairstepCharges a price for a range.
    quantity
    Quantity of the item which is represented by this charge.
    optional, integer, min=0
    amount
    Total amount of this charge. Typically equals to unit amount x quantity.
    optional, in cents, min=0
    currency_code
    The currency code (ISO 4217 format) for the charge.
    string, max chars=3
    discount_amount
    Total discounts for this charge.
    optional, in cents, min=0
    description
    Detailed description about this charge.
    optional, string, max chars=250
    entity_type
    Specifies the modelled entity (plan / addon etc) this lineitem is based on.
    enumerated string
    Possible values are
    plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan id.planIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan id.addonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon id.adhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case.
    entity_id
    The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.
    optional, string, max chars=100
    is_voided
    Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.
    boolean, default=false
    voided_at
    Timestamp indicating the date and time this charge got voided.
    optional, timestamp(UTC) in seconds
    deleted
    Indicates that this resource has been deleted.
    boolean
    The list of tiers applicable for this line item.
    optional, list of line_item_tier
    Tier attributes
    line_item_id
    Uniquely identifies a line_item.
    optional, string, max chars=40
    starting_unit
    The lower limit of a range of units for the tier.
    integer, min=1
    ending_unit
    The upper limit of a range of units for the tier.
    optional, integer
    quantity_used
    The number of units purchased in a range.
    integer, min=1
    unit_amount
    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.
    in cents, min=0

    Generates an estimate for the 'create subscription' operation. This is similar to the Create Subscription API but no subscription will be created, only an estimate for this operation is created.

    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.
    • estimate.next_invoice_estimate has details of the invoice that will be generated on the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation and this subscription has next billing.

      If the subscription is created in trial/future states, estimate.invoice_estimate will not be present as no immediate invoice would be generated. However, estimate.next_invoice_estimate will be returned which is a preview of the invoice that would be generated at a later date when the subscription becomes 'active'.

    • estimate.unbilled_charge_estimates has details of the unbilled charges. This is returned only if invoice_immediately is set as false. But this is not applicable for the ‘Subscription renewal estimate’ operation.

    Note: If you have configured EU VAT or Customized taxes, you need to specify the applicable parameters for calculating taxes - billing_address[], shipping_address[], customer[vat_number], customer[taxability] etc. Otherwise tax calculation will be ignored.

    Related Tutorial

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/estimates/create_subscription \
         -u {site_api_key}:\
         -d subscription[plan_id]="no_trial" \
         -d billing_address[line1]="PO Box 9999" \
         -d billing_address[city]="Walnut" \
         -d billing_address[zip]="91789" \
         -d billing_address[country]="US"
    copy
    curl  https://{site}.chargebee.com/api/v2/estimates/create_subscription \
         -u {site_api_key}:\
         -d subscription[plan_id]="no_trial" \
         -d billing_address[line1]="PO Box 9999" \
         -d billing_address[city]="Walnut" \
         -d billing_address[zip]="91789" \
         -d billing_address[country]="US"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469195, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkAU5yP", "date": 1517469195, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYkAU5yP", "date_from": 1517469195, "date_to": 1519888395, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkB05yR", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "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", "next_billing_at": 1519888395, "object": "subscription_estimate", "status": "active" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/estimates/create_subscription
    billing_cycles
    Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
    optional, integer, min=0
    mandatory_addons_to_remove[0..n]
    List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
    optional, list of string
    terms_to_charge
    The number of future renewals for which advance invoicing is done. However, if a new term gets started in this operation, the specified terms_to_charge will be inclusive of this new term.
    optional, integer, min=1
    billing_alignment_mode
    Applicable when calendar billing is enabled and subscription is getting created in active / non_renewing states. Unless specified the configured default value will be used.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately.delayedSubscription period will be aligned with the configured billing date at a later date (subsequent renewals).
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    invoice_immediately
    Applicable when charges are added during this operation. If specified as false, these charges will be added to unbilled charges. The default value for this parameter will be as per your site settings.
    optional, boolean
    client_profile_id
    Indicates the Client profile id for the customer. This is applicable only if you use Chargebee’s AvaTax for Communications integration.
    optional, string, max chars=50
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
    optional, string, max chars=50
    subscription[plan_id]
    Identifier of the plan for this subscription.
    required, string, max chars=100
    subscription[plan_quantity]
    Plan quantity for this subscription.
    optional, integer, default=1, min=1
    subscription[plan_unit_price]
    Amount that will override the Plan's default price.
    optional, in cents, min=0
    subscription[setup_fee]
    Amount that will override the default setup fee.
    optional, in cents, min=0
    subscription[trial_end]
    The time at which the trial ends for this subscription. Can be specified to override the default trial period.If '0' is passed, the subscription will be activated immediately.
    optional, timestamp(UTC) in seconds
    subscription[start_date]
    Allows you to specify a future date or a past date on which the subscription starts.Past dates can be entered in case the subscription has already started. Any past date entered must be within the current billing cycle/plan term. The subscription will start immediately if this parameter is not passed.
    optional, timestamp(UTC) in seconds
    subscription[contract_term_billing_cycle_on_renewal]
    Number of billing cycles the new contract term should run for, on contract renewal. The default value is as specified in the site settings.
    optional, integer, min=1, max=100
    +
    billing_address
    Parameters for billing_address
    pass parameters as billing_address[<param name>]
    billing_address[line1]
    Address line 1.
    optional, string, max chars=150
    billing_address[line2]
    Address line 2.
    optional, string, max chars=150
    billing_address[line3]
    Address line 3.
    optional, string, max chars=150
    billing_address[city]
    City.
    optional, string, max chars=50
    billing_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    billing_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    billing_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    billing_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[line1]
    Address line 1.
    optional, string, max chars=180
    shipping_address[line2]
    Address line 2.
    optional, string, max chars=150
    shipping_address[line3]
    Address line 3.
    optional, string, max chars=150
    shipping_address[city]
    City.
    optional, string, max chars=50
    shipping_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    shipping_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    shipping_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    shipping_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[vat_number]
    VAT number of this customer. VIES validation will not happen for this parameter.
    optional, string, max chars=20
    customer[registered_for_gst]
    Confirms that a customer is registered under GST. This field is available for Australia only.
    optional, boolean
    customer[taxability]
    Specifies if the customer is liable for tax.
    optional, enumerated string, default=taxable
    Possible values are
    taxableCustomer is taxable.exempt
    • Customer is exempted from tax
    • 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.
    .
    customer[entity_code]
    The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's AvaTax for Sales integration.
    optional, enumerated string
    Possible values are
    aFederal government.bState government.cTribe/Status Indian/Indian Band.dForeign diplomat.
    eCharitable or benevolent organization.fReligious organization.gResale.hCommercial agricultural production.iIndustrial production/manufacturer.jDirect pay permit.kDirect mail.lOther or custom.mEducational organization.nLocal government.pCommercial aquaculture.qCommercial Fishery.rNon-resident.med1US Medical Device Excise Tax with exempt sales tax.med2US Medical Device Excise Tax with taxable sales tax.
    Show all values[+]
    customer[exempt_number]
    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.
    optional, string, max chars=100
    customer[exemption_details]
    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, jsonarray
    customer[customer_type]
    Indicates the type of the customer. This is applicable only if you use Chargebee’s AvaTax for Communications integration.
    optional, enumerated string
    Possible values are
    residentialWhen the purchase is made by a customer for home use.businessWhen the purchase is made at a place of business.senior_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 breaks.industrialWhen the purchase is made by an industrial business.
    +
    contract_term
    Parameters for contract_term
    pass parameters as contract_term[<param name>]
    contract_term[action_at_term_end]
    Action to be taken when the contract term completes.
    optional, enumerated string, default=cancel
    Possible values are
    renew
  • 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 renew.
  • .
    evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.
    contract_term[cancellation_cutoff_period]
    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.
    optional, integer, default=0
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[billing_cycles][0..n]
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
    optional, integer, min=1
    addons[trial_end][0..n]
    The time at which the trial ends for the addon. This value can only be set for subscriptions that start with an active or non-renewing status. Once set, the value can't be changed. (Addon trial periods must be enabled by Chargebee Support.).
    optional, timestamp(UTC) in seconds
    +
    event_based_addons
    Parameters for event_based_addons. Multiple event_based_addons can be passed by specifying unique indices.
    pass parameters as event_based_addons[<param name>][<idx:0..n>]
    event_based_addons[id][0..n]
    A unique 'id' used to identify the addon.
    optional, string, max chars=100
    event_based_addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    event_based_addons[unit_price][0..n]
    Amount that will override the Addon's default price.
    optional, in cents, min=0
    event_based_addons[service_period_in_days][0..n]
    Defines service period of the addon in days from the day of charge.
    optional, integer, min=1, max=730
    event_based_addons[on_event][0..n]
    Event on which this addon will be charged.
    optional, enumerated string
    Possible values are
    subscription_creationAddon will be charged on subscription creation.subscription_trial_startAddon will be charged when the trial period starts.plan_activationAddon will be charged on plan activation.subscription_activationAddon will be charged on subscription activation.contract_terminationAddon will be charged on contract termination.
    event_based_addons[charge_once][0..n]
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
    optional, boolean, default=true
    event_based_addons[charge_on][0..n]
    Indicates when the non-recurring addon will be charged.
    optional, enumerated string
    Possible values are
    immediatelyCharges for the addon will be applied immediately.on_eventCharge for the addon will be applied on the occurrence of a specified event.
    Resource object representing estimate.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnJjRnFYkCP5yS/create_subscription_estimate \
         -G  \
         -u {site_api_key}:\
    copy
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnJjRnFYkCP5yS/create_subscription_estimate \
         -G  \
         -u {site_api_key}:\

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469195, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkCP5yS", "date": 1517469195, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYkCP5yS", "date_from": 1517469195, "date_to": 1519888395, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkDY5yW", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "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", "next_billing_at": 1519888395, "object": "subscription_estimate", "status": "active" } }}

    URL Format GET

    https://{site}.chargebee.com/api/v2/customers/{customer_id}/create_subscription_estimate
    use_existing_balances
    If true, all the existing balances - promotional credits, refundable credits and excess payments - will be included for the invoice estimate.
    optional, boolean, default=true
    invoice_immediately
    Applicable when charges are added during this operation. If specified as false, these charges will be added to unbilled charges. The default value for this parameter will be as per your site settings.
    optional, boolean
    billing_cycles
    Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
    optional, integer, min=0
    mandatory_addons_to_remove[0..n]
    List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
    optional, list of string
    terms_to_charge
    The number of future renewals for which advance invoicing is done. However, if a new term gets started in this operation, the specified terms_to_charge will be inclusive of this new term.
    optional, integer, min=1
    billing_alignment_mode
    Applicable when calendar billing is enabled and subscription is getting created in active / non_renewing states. Unless specified the configured default value will be used.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately.delayedSubscription period will be aligned with the configured billing date at a later date (subsequent renewals).
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
    optional, string, max chars=50
    subscription[plan_id]
    Identifier of the plan for this subscription.
    required, string, max chars=100
    subscription[plan_quantity]
    Plan quantity for this subscription.
    optional, integer, default=1, min=1
    subscription[plan_unit_price]
    Amount that will override the Plan's default price.
    optional, in cents, min=0
    subscription[setup_fee]
    Amount that will override the default setup fee.
    optional, in cents, min=0
    subscription[trial_end]
    The time at which the trial ends for this subscription. Can be specified to override the default trial period.If '0' is passed, the subscription will be activated immediately.
    optional, timestamp(UTC) in seconds
    subscription[start_date]
    Allows you to specify a future date or a past date on which the subscription starts.Past dates can be entered in case the subscription has already started. Any past date entered must be within the current billing cycle/plan term. The subscription will start immediately if this parameter is not passed.
    optional, timestamp(UTC) in seconds
    subscription[contract_term_billing_cycle_on_renewal]
    Number of billing cycles the new contract term should run for, on contract renewal. The default value is as specified in the site settings.
    optional, integer, min=1, max=100
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[line1]
    Address line 1.
    optional, string, max chars=180
    shipping_address[line2]
    Address line 2.
    optional, string, max chars=150
    shipping_address[line3]
    Address line 3.
    optional, string, max chars=150
    shipping_address[city]
    City.
    optional, string, max chars=50
    shipping_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    shipping_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    shipping_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    shipping_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    contract_term
    Parameters for contract_term
    pass parameters as contract_term[<param name>]
    contract_term[action_at_term_end]
    Action to be taken when the contract term completes.
    optional, enumerated string, default=cancel
    Possible values are
    renew
  • 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 renew.
  • .
    evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.
    contract_term[cancellation_cutoff_period]
    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.
    optional, integer, default=0
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[billing_cycles][0..n]
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
    optional, integer, min=1
    addons[trial_end][0..n]
    The time at which the trial ends for the addon. This value can only be set for subscriptions that start with an active or non-renewing status. Once set, the value can't be changed. (Addon trial periods must be enabled by Chargebee Support.).
    optional, timestamp(UTC) in seconds
    +
    event_based_addons
    Parameters for event_based_addons. Multiple event_based_addons can be passed by specifying unique indices.
    pass parameters as event_based_addons[<param name>][<idx:0..n>]
    event_based_addons[id][0..n]
    A unique 'id' used to identify the addon.
    optional, string, max chars=100
    event_based_addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    event_based_addons[unit_price][0..n]
    Amount that will override the Addon's default price.
    optional, in cents, min=0
    event_based_addons[service_period_in_days][0..n]
    Defines service period of the addon in days from the day of charge.
    optional, integer, min=1, max=730
    event_based_addons[on_event][0..n]
    Event on which this addon will be charged.
    optional, enumerated string
    Possible values are
    subscription_creationAddon will be charged on subscription creation.subscription_trial_startAddon will be charged when the trial period starts.plan_activationAddon will be charged on plan activation.subscription_activationAddon will be charged on subscription activation.contract_terminationAddon will be charged on contract termination.
    event_based_addons[charge_once][0..n]
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
    optional, boolean, default=true
    event_based_addons[charge_on][0..n]
    Indicates when the non-recurring addon will be charged.
    optional, enumerated string
    Possible values are
    immediatelyCharges for the addon will be applied immediately.on_eventCharge for the addon will be applied on the occurrence of a specified event.
    Resource object representing estimate.
    always returned

    Generates an estimate for the 'update subscription' operation. The input will be similar to the Update Subscription API but subscription will not be updated, only an estimate will be created.

    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
      • end_of_term parameter is true
      • prorate parameter is false
      • No recurring items (plan and addons) are changed . E.g. only a coupon is applied or billing_cycles is updated.
      • For certain types of changes - like plan/addon quantity downgrades - only Credit Notes will be created and no invoice gets generated.
    • 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 (scenarios 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. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.

    • 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. But this is not applicable for the ‘Subscription renewal estimate’ operation.

    Note: If you have configured EU VAT or Customized taxes, you need to specify the applicable parameters for calculating taxes - billing_address[], shipping_address[], customer[vat_number], customer[taxability] etc. Otherwise tax calculation will be ignored.

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/estimates/update_subscription \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnJjRnFYkJj5yg" \
         -d subscription[plan_id]="plan1" \
         -d billing_address[line1]="PO Box 9999" \
         -d billing_address[city]="Walnut" \
         -d billing_address[zip]="91789" \
         -d billing_address[country]="US"
    copy
    curl  https://{site}.chargebee.com/api/v2/estimates/update_subscription \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnJjRnFYkJj5yg" \
         -d subscription[plan_id]="plan1" \
         -d billing_address[line1]="PO Box 9999" \
         -d billing_address[city]="Walnut" \
         -d billing_address[zip]="91789" \
         -d billing_address[country]="US"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469195, "credit_note_estimates": [ { "amount_allocated": 895, "amount_available": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkJj5yg", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYkJj5yg", "date_from": 1517469195, "date_to": 1519888395, "description": "No Trial - Prorated Credits for 01-Feb-2018 - 01-Mar-2018", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkNE5yq", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYkJj5yg", "tax_amount": 0, "unit_amount": 895 }, {..} ], "object": "credit_note_estimate", "price_type": "tax_exclusive", "reference_invoice_id": "__demo_inv__6", "round_off_amount": 0, "sub_total": 895, "taxes": [], "total": 895, "type": "adjustment" }, {..} ], "invoice_estimate": { "amount_due": 1500, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkJj5yg", "date": 1517469195, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 1500, "customer_id": "__test__KyVnJjRnFYkJj5yg", "date_from": 1517469195, "date_to": 1519888395, "description": "Plan1 - Prorated Charges", "discount_amount": 0, "entity_id": "plan1", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkN75yo", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYkJj5yg", "tax_amount": 0, "unit_amount": 1500 }, {..} ], "object": "invoice_estimate", "price_type": "tax_exclusive", "recurring": true, "round_off_amount": 0, "sub_total": 1500, "taxes": [], "total": 1500 }, "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnJjRnFYkJj5yg", "next_billing_at": 1519888395, "object": "subscription_estimate", "status": "active" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/estimates/update_subscription
    replace_addon_list
    Should be true if the existing addons should be replaced with the ones that are being passed.
    optional, boolean
    mandatory_addons_to_remove[0..n]
    List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
    optional, list of string
    billing_cycles
    Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
    optional, integer, min=0
    terms_to_charge
    The number of future renewals for which advance invoicing is done. However, if a new term gets started in this operation, the specified terms_to_charge will be inclusive of this new term.
    optional, integer, min=1
    reactivate_from
    The time from which this subscription should be reactivated.
    optional, timestamp(UTC) in seconds
    billing_alignment_mode
    Applicable when calendar billing is enabled and a new term gets started during this operation. Unless specified the configured default value will be used.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately.delayedSubscription period will be aligned with the configured billing date at a later date (subsequent renewals).
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    replace_coupon_list
    Should be true if the existing coupons should be replaced with the ones that are being passed.
    optional, boolean
    prorate
    Add Prorated Credits and Charges, if applicable, while updating the subscription. If this parameter is not passed, the default value set in the Site Settings will be used. Else, it will be assumed as true.
    optional, boolean
    end_of_term
    You can specify when you want to update the subscription.
    optional, boolean
    force_term_reset
    Applicable for 'Active' & 'Non Renewing' states alone. Generally, subscription's term will be reset (i.e current term is ended and a new term starts immediately) when a new plan having different billing frequency is specified in the input. For all the other cases, the subscription's term will remain intact. Now for this later scenario, if you want to force a term reset you can specify this param as 'true'.
    Note: Specifying this value as 'false' has no impact on the default behaviour.
    optional, boolean, default=false
    reactivate
    Applicable only for cancelled subscriptions. Once this is passed as true, cancelled subscription will become active; otherwise subscription changes will be made but the the subscription state will remain cancelled. If not passed, subscription will be activated only if there is any change in subscription data.
    optional, boolean
    include_delayed_charges
    If true, all the unbilled charges will be included for the invoice estimate.
    optional, boolean, default=false
    use_existing_balances
    If true, all the existing balances - promotional credits, refundable credits and excess payments - will be included for the invoice estimate.
    optional, boolean, default=true
    invoice_immediately
    Applicable when charges are added during this operation. If specified as false, these charges will be added to unbilled charges. The default value for this parameter will be as per your site settings.
    optional, boolean
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
    required, string, max chars=50
    subscription[plan_id]
    Identifier of the plan for this subscription.
    optional, string, max chars=100
    subscription[plan_quantity]
    Represents the plan quantity for this subscription.
    optional, integer, min=1
    subscription[plan_unit_price]
    Amount that will override the Plan's default price.
    optional, in cents, min=0
    subscription[setup_fee]
    Amount that will override the default setup fee.
    optional, in cents, min=0
    subscription[start_date]
    Applicable only for 'future' subscriptions. The new start date of the 'future' subscription.
    optional, timestamp(UTC) in seconds
    subscription[trial_end]
    The time at which the trial should end for this subscription. Can be specified to override the default trial period defined in plan. If '0' is passed, the subscription will be activated immediately.
    optional, timestamp(UTC) in seconds
    +
    billing_address
    Parameters for billing_address
    pass parameters as billing_address[<param name>]
    billing_address[line1]
    Address line 1.
    optional, string, max chars=150
    billing_address[line2]
    Address line 2.
    optional, string, max chars=150
    billing_address[line3]
    Address line 3.
    optional, string, max chars=150
    billing_address[city]
    City.
    optional, string, max chars=50
    billing_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    billing_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    billing_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    billing_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[line1]
    Address line 1.
    optional, string, max chars=180
    shipping_address[line2]
    Address line 2.
    optional, string, max chars=150
    shipping_address[line3]
    Address line 3.
    optional, string, max chars=150
    shipping_address[city]
    City.
    optional, string, max chars=50
    shipping_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    shipping_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    shipping_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    shipping_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[vat_number]
    VAT number of this customer. VIES validation will not happen for this parameter.
    optional, string, max chars=20
    customer[registered_for_gst]
    Confirms that a customer is registered under GST. This field is available for Australia only.
    optional, boolean
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[billing_cycles][0..n]
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
    optional, integer, min=1
    addons[trial_end][0..n]
    The time at which the trial ends for the addon. To update this value, redo the complete addon set using replace_addon_list. (Addon trial periods must be enabled by Chargebee Support.).
    optional, timestamp(UTC) in seconds
    +
    event_based_addons
    Parameters for event_based_addons. Multiple event_based_addons can be passed by specifying unique indices.
    pass parameters as event_based_addons[<param name>][<idx:0..n>]
    event_based_addons[id][0..n]
    A unique 'id' used to identify the addon.
    optional, string, max chars=100
    event_based_addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    event_based_addons[unit_price][0..n]
    Amount that will override the Addon's default price.
    optional, in cents, min=0
    event_based_addons[service_period_in_days][0..n]
    Defines service period of the addon in days from the day of charge.
    optional, integer, min=1, max=730
    event_based_addons[charge_on][0..n]
    Indicates when the non-recurring addon will be charged.
    optional, enumerated string
    Possible values are
    immediatelyCharges for the addon will be applied immediately.on_eventCharge for the addon will be applied on the occurrence of a specified event.
    event_based_addons[on_event][0..n]
    Event on which this addon will be charged.
    optional, enumerated string
    Possible values are
    subscription_creationAddon will be charged on subscription creation.subscription_trial_startAddon will be charged when the trial period starts.plan_activationAddon will be charged on plan activation.subscription_activationAddon will be charged on subscription activation.contract_terminationAddon will be charged on contract termination.
    event_based_addons[charge_once][0..n]
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
    optional, boolean
    Resource object representing estimate.
    always returned

    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.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjNH5xl/renewal_estimate \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjNH5xl/renewal_estimate \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469192, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYjNH5xl", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYjNH5xl", "date_from": 1519888392, "date_to": 1522566792, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYjQN5xs", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYjNH5xl", "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__KyVnJjRnFYjNH5xl", "next_billing_at": 1519888392, "object": "subscription_estimate", "status": "active" } }}

    URL Format GET

    https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/renewal_estimate
    include_delayed_charges
    If true, all the unbilled charges will be included for the invoice estimate.
    optional, boolean, default=true
    use_existing_balances
    If true, all the existing balances - promotional credits, refundable credits and excess payments - will be included for the invoice estimate.
    optional, boolean, default=true
    ignore_scheduled_cancellation
    if true, ignores scheduled cancellation for non renewing subscription.
    optional, boolean, default=false
    ignore_scheduled_changes
    If true, ignores all recurring charges scheduled during renewal.
    optional, boolean, default=false
    Resource object representing estimate.
    always returned

    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.

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnJjRnFYkF55yX/upcoming_invoices_estimate \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnJjRnFYkF55yX/upcoming_invoices_estimate \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469195, "invoice_estimates": [ { "amount_due": 1790, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYkF55yX", "date": 1517469195, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYkF55yX", "date_from": 1517469195, "date_to": 1519888395, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYkFl5yZ", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYkF55yX", "tax_amount": 0, "unit_amount": 895 }, {..} ], "object": "invoice_estimate", "price_type": "tax_exclusive", "recurring": true, "round_off_amount": 0, "sub_total": 1790, "taxes": [], "total": 1790 }, {..} ], "object": "estimate" }}

    URL Format GET

    https://{site}.chargebee.com/api/v2/customers/{customer_id}/upcoming_invoices_estimate
    Resource object representing estimate.
    always returned

    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.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjJQ5xe/change_term_end_estimate \
         -u {site_api_key}:\
         -d term_ends_at=1566697500
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjJQ5xe/change_term_end_estimate \
         -u {site_api_key}:\
         -d term_ends_at=1566697500

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469192, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnJjRnFYjJQ5xe", "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
    term_ends_at
    The time at which the current term should end for this subscription.
    optional, timestamp(UTC) in seconds
    prorate
    Applicable for active / non_renewing subscriptions. If specified as true prorated charges / credits will be added during this operation.
    optional, boolean
    invoice_immediately
    Applicable when charges are added during this operation. If specified as false, these charges will be added to unbilled charges. The default value for this parameter will be as per your site settings.
    optional, boolean
    Resource object representing estimate.
    always returned

    Generates an estimate for the 'cancel subscription' operation. This is similar to the Cancel a subscription API, but the subscription will not be cancelled. 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.
    • 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.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjF45xX/cancel_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d end_of_term="true"
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjF45xX/cancel_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d end_of_term="true"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469191, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnJjRnFYjF45xX", "object": "subscription_estimate", "status": "non_renewing" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/cancel_subscription_estimate
    end_of_term
    Set this to true if you want to cancel the subscription at the end of the current subscription billing cycle.
    optional, boolean, default=false
    credit_option_for_current_term_charges
    Specify this if you want to issue credits against the current term charges. Not applicable when 'end_of_term' is true.
    optional, enumerated string
    Possible values are
    noneNo credits will be issued against current term charges.prorateProrated credits for the unused period will be issued against current term charges.fullCredits will be issued for all the current term charges.
    unbilled_charges_option
    Applicable when unbilled charges are present for this subscription. If specified as delete, these charges will be deleted instead of getting invoiced immediately. Note: On the invoice raised, an automatic charge will be attempted on the payment method available if customer's auto-collection property is ‘ON’. Not applicable when 'end_of_term' is true.
    optional, enumerated string
    Possible values are
    invoiceUnbilled charges will be raised as an invoice. An attempt to collect payment will be made.deleteUnbilled charges will be deleted.
    account_receivables_handling
    Applicable when the subscription has past due invoices. Specify this if you want to close the due invoices of the subscription. If specified as schedule_payment_collection/write_off, the due invoices of the subscription will be qualified for the selected operation after the remaining refundable credits and excess payments are applied. Note: The payment collection attempt will be asynchronous. Not applicable when 'end_of_term' is true.
    optional, enumerated string
    Possible values are
    no_actionNo action is taken.schedule_payment_collectionAn automatic charge for the due amount of the past invoices will be attempted on the payment method available, if customer's auto-collection property is ‘ON’.write_offThe amount due in the invoices will be written-off. Credit notes created due to write-off will not be sent in the response.
    refundable_credits_handling
    Applicable when the customer has remaining refundable credits(issued against online payments). If specified as schedule_refund, the refund will be initiated for these credits after they are applied against the subscription’s past due invoices if any. Note: The refunds initiated will be asynchronous. Not applicable when 'end_of_term' is true.
    optional, enumerated string
    Possible values are
    no_actionNo action is taken. .schedule_refundInitiates refund of the remaining credits.
    Resource object representing estimate.
    always returned

    This API provides an estimate of the details pertaining to the pause_subscription operation. It returns attributes such as pause_date, resume_date, etc. This is similar to the Pause a subscription API, but the subscription will not be 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 will be generated immediately. This will not be present if no immediate invoice is generated for this operation.
    • 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.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjz95y9/pause_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d pause_option="specific_date" \
         -d subscription[pause_date]=1566698400
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYjz95y9/pause_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d pause_option="specific_date" \
         -d subscription[pause_date]=1566698400

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469194, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnJjRnFYjz95y9", "next_billing_at": 1519888394, "object": "subscription_estimate", "pause_date": 1566698400, "status": "active" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/pause_subscription_estimate
    pause_option
    List of options to pause the subscription.
    optional, enumerated string
    Possible values are
    immediatelyPause immediately.end_of_termPause at the end of current term.specific_datePause on a specific date.
    unbilled_charges_handling
    Applicable when unbilled charges are present for the subscription and pause_option is set as 'immediately'. Note: On the invoice raised, an automatic charge will be attempted on the payment method available, if customer's auto-collection property is ‘ON’.
    optional, enumerated string
    Possible values are
    no_actionRetain as unbilled.invoiceInvoice charges.
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[pause_date]
    Date on which the subscription will be paused.
    optional, timestamp(UTC) in seconds
    subscription[resume_date]
    Date on which the subscription will be resumed.
    optional, timestamp(UTC) in seconds
    Resource object representing estimate.
    always returned

    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.

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYk4Y5yG/resume_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d resume_option="immediately"
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnJjRnFYk4Y5yG/resume_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d resume_option="immediately"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469195, "next_invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYk4Y5yG", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnJjRnFYk4Y5yG", "date_from": 1519888394, "date_to": 1522566794, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnJjRnFYk8l5yO", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYk4Y5yG", "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__KyVnJjRnFYk4Y5yG", "next_billing_at": 1519888394, "object": "subscription_estimate", "status": "active" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/resume_subscription_estimate
    resume_option
    List of options to resume the subscription.
    optional, enumerated string
    Possible values are
    immediatelyResume immediately.specific_dateResume on a specific date.
    charges_handling
    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.
    optional, enumerated string
    Possible values are
    invoice_immediatelyInvoice immediately.add_to_unbilled_chargesAdd to unbilled charges.
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[resume_date]
    Date on which the subscription will be resumed.
    optional, timestamp(UTC) in seconds
    Resource object representing estimate.
    always returned

    Generates an estimate for the 'create a gift' operation. This is similar to the Create a gift API, but the gift subscription will not be created. Only an estimate for this operation is created.

    In the response,

    • estimate.subscription_estimate has the gift subscription details.
    • estimate.invoice_estimate has details of the gift invoice that will be generated immediately.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/estimates/gift_subscription \
         -u {site_api_key}:\
         -d subscription[plan_id]="GiftPlan$100" \
         -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"
    copy
    curl  https://{site}.chargebee.com/api/v2/estimates/gift_subscription \
         -u {site_api_key}:\
         -d subscription[plan_id]="GiftPlan$100" \
         -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"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469194, "invoice_estimate": { "amount_due": 10000, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "gifter", "date": 1517469194, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 10000, "customer_id": "gifter", "date_from": 1612163599, "date_to": 1614582799, "description": "New Year Gift", "discount_amount": 0, "entity_id": "GiftPlan$100", "entity_type": "plan", "id": "li___test__KyVnJjRnFYjwM5y6", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "subscription_id": "__test__KyVnJjRnFYjvQ5y4", "tax_amount": 0, "unit_amount": 10000 }, {..} ], "object": "invoice_estimate", "price_type": "tax_exclusive", "recurring": true, "round_off_amount": 0, "sub_total": 10000, "taxes": [], "total": 10000 }, "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnJjRnFYjvQ5y4", "object": "subscription_estimate", "status": "future" } }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/estimates/gift_subscription
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    +
    gift
    Parameters for gift
    pass parameters as gift[<param name>]
    gift[scheduled_at]
    Indicates the date on which the gift notification is sent to the receiver. If not passed, the receiver is notified immediately.
    optional, timestamp(UTC) in seconds
    gift[auto_claim]
    When true, the claim happens automatically. When not passed, the default value in the site settings is used.
    optional, boolean
    gift[no_expiry]
    When true, indicates that the gift does not expire. Do not pass or pass as false when auto_claim is set. .
    optional, boolean
    gift[claim_expiry_date]
    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.
    optional, timestamp(UTC) in seconds
    +
    gifter
    Parameters for gifter
    pass parameters as gifter[<param name>]
    gifter[customer_id]
    Gifter customer id.
    required, string, max chars=50
    gifter[signature]
    Gifter sign-off name.
    required, string, max chars=50
    gifter[note]
    Personalized message for the gift.
    optional, string, max chars=500
    gifter[payment_src_id]
    Identifier of the payment source.
    optional, string, max chars=40
    +
    gift_receiver
    Parameters for gift_receiver
    pass parameters as gift_receiver[<param name>]
    gift_receiver[customer_id]
    Receiver customer id.
    required, string, max chars=50
    gift_receiver[first_name]
    First name of the receiver as given by the gifter.
    required, string, max chars=150
    gift_receiver[last_name]
    Last name of the receiver as given by the gifter,.
    required, string, max chars=150
    gift_receiver[email]
    Email of the receiver. All gift related emails are sent to this email.
    required, string, max chars=70
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[plan_id]
    Identifier of the plan for this subscription.
    required, string, max chars=100
    subscription[plan_quantity]
    Plan quantity for this subscription.
    optional, integer, default=1, min=1
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[first_name]
    First name.
    optional, string, max chars=150
    shipping_address[last_name]
    Last name.
    optional, string, max chars=150
    shipping_address[email]
    Email.
    optional, string, max chars=70
    shipping_address[company]
    Company name.
    optional, string, max chars=250
    shipping_address[phone]
    Phone number.
    optional, string, max chars=50
    shipping_address[line1]
    Address line 1.
    optional, string, max chars=180
    shipping_address[line2]
    Address line 2.
    optional, string, max chars=150
    shipping_address[line3]
    Address line 3.
    optional, string, max chars=150
    shipping_address[city]
    City.
    optional, string, max chars=50
    shipping_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    shipping_address[state]
    The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
    optional, string, max chars=50
    shipping_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    shipping_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    shipping_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    Resource object representing estimate.
    always returned

    Generates an estimate for the 'create an invoice' operation. This is similar to the Create an invoice API, but the invoice will not be generated. Only an estimate for this operation is created.

    In the response,

    • estimate.invoice_estimate has details of the invoice that will be generated immediately.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/estimates/create_invoice \
         -u {site_api_key}:\
         -d invoice[customer_id]="__test__KyVnJjRnFYjRp5xt" \
         -d charges[amount][0]=1000 \
         -d charges[description][0]="Adhoc charge"
    copy
    curl  https://{site}.chargebee.com/api/v2/estimates/create_invoice \
         -u {site_api_key}:\
         -d invoice[customer_id]="__test__KyVnJjRnFYjRp5xt" \
         -d charges[amount][0]=1000 \
         -d charges[description][0]="Adhoc charge"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517469192, "invoice_estimate": { "amount_due": 1000, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnJjRnFYjRp5xt", "date": 1517469192, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 1000, "customer_id": "__test__KyVnJjRnFYjRp5xt", "date_from": 1517469192, "date_to": 1517469192, "description": "Adhoc charge", "discount_amount": 0, "entity_type": "adhoc", "id": "li___test__KyVnJjRnFYjT35xw", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "tax_amount": 0, "unit_amount": 1000 }, {..} ], "object": "invoice_estimate", "price_type": "tax_exclusive", "recurring": false, "round_off_amount": 0, "sub_total": 1000, "taxes": [], "total": 1000 }, "object": "estimate" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/estimates/create_invoice
    currency_code
    The currency code (ISO 4217 format) of the invoice amount.
    required if Multicurrency is enabled, string, max chars=3
    invoice_notes
    Invoice Notes for this resource. Read More.
    optional, string, max chars=2000
    coupon_ids[0..n]
    List of Coupons to be .
    optional, list of string
    authorization_transaction_id
    Authorization transaction to be captured.
    optional, string, max chars=40
    payment_source_id
    Payment source to be used for this payment.
    optional, string, max chars=40
    auto_collection
    The customer level auto collection will be override if specified.
    optional, enumerated string
    Possible values are
    onWhenever an invoice is created, an automatic attempt will be made to charge.offWhenever an invoice is created as payment due.
    +
    invoice
    Parameters for invoice
    pass parameters as invoice[<param name>]
    invoice[customer_id]
    Identifier of the customer for which this invoice needs to be created. Should be specified if 'subscription_id' is not specified.
    optional, string, max chars=50
    invoice[subscription_id]
    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=50
    invoice[po_number]
    Purchase Order Number for this invoice.
    optional, string, max chars=100
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[first_name]
    First name.
    optional, string, max chars=150
    shipping_address[last_name]
    Last name.
    optional, string, max chars=150
    shipping_address[email]
    Email.
    optional, string, max chars=70
    shipping_address[company]
    Company name.
    optional, string, max chars=250
    shipping_address[phone]
    Phone number.
    optional, string, max chars=50
    shipping_address[line1]
    Address line 1.
    optional, string, max chars=180
    shipping_address[line2]
    Address line 2.
    optional, string, max chars=150
    shipping_address[line3]
    Address line 3.
    optional, string, max chars=150
    shipping_address[city]
    City.
    optional, string, max chars=50
    shipping_address[state_code]
    The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
    Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
    optional, string, max chars=50
    shipping_address[state]
    The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
    optional, string, max chars=50
    shipping_address[zip]
    Zip or Postal code.
    optional, string, max chars=20
    shipping_address[country]
    2-letter ISO 3166 alpha-2 country code.
    optional, string, max chars=50
    shipping_address[validation_status]
    The address verification status.
    optional, enumerated string, default=not_validated
    Possible values are
    not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[date_from][0..n]
    The time when the service period for the addon starts.
    optional, timestamp(UTC) in seconds
    addons[date_to][0..n]
    The time when the service period for the addon ends.
    optional, timestamp(UTC) in seconds
    +
    charges
    Parameters for charges. Multiple charges can be passed by specifying unique indices.
    pass parameters as charges[<param name>][<idx:0..n>]
    charges[amount][0..n]
    The amount to be charged.
    optional, in cents, min=1
    charges[description][0..n]
    Description for this charge.
    optional, string, max chars=250
    charges[avalara_sale_type][0..n]
    Indicates the type of sale carried out. This is applicable only if you use Chargebee’s AvaTax for Communications integration.
    optional, enumerated string
    Possible values are
    wholesaleTransaction is a sale to another company that will resell your product or service to another consumer.retailTransaction is a sale to an end user.consumedTransaction is for an item that is consumed directly.vendor_useTransaction is for an item that is subject to vendor use tax.
    charges[avalara_transaction_type][0..n]
    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.
    optional, integer
    charges[avalara_service_type][0..n]
    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, integer
    charges[date_from][0..n]
    The time when the service period for the charge starts.
    optional, timestamp(UTC) in seconds
    charges[date_to][0..n]
    The time when the service period for the charge ends.
    optional, timestamp(UTC) in seconds
    charges[taxable][0..n]

    optional, boolean, default=true
    charges[tax_profile_id][0..n]
    Tax profile of the charge.
    optional, string, max chars=50
    charges[avalara_tax_code][0..n]
    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
    charges[taxjar_product_code][0..n]
    The TaxJar product codes to which items are mapped to should be provided here. Applicable only if you use Chargebee's TaxJar integration.
    optional, string, max chars=50
    Resource object representing estimate.
    always returned