'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": 1517505710, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl2E82aS", "date": 1517505710, "line_item_discounts": [], "line_item_taxes": [], "line_items": [{ "amount": 895, "customer_id": "__test__KyVnHhSBWl2E82aS", "date_from": 1517505710, "date_to": 1519924910, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWl2Eq2aU", "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": 1519924910, "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
The first name of the contact.
optional, string, max chars=150
last_name
The last name of the contact.
optional, string, max chars=150
email
The email address.
optional, string, max chars=70
company
The company name.
optional, string, max chars=250
phone
The 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
The name of the 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 line item belongs to.
    optional, string, max chars=3
    date_from
    Start date of this line item.
    timestamp(UTC) in seconds
    date_to
    End date of this line item.
    timestamp(UTC) in seconds
    unit_amount
    Unit amount of the line item.
    in cents
    quantity
    Quantity of the recurring item which is represented by this line item.
    optional, integer, default=1
    amount
    Total amount of this line item. Typically equals to unit amount x quantity.
    optional, in cents
    pricing_model
    The pricing scheme for this item. In Product Catalog v2, the pricing scheme for this item price.
    optional, enumerated string
    Possible values are
    flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThe per unit price is based on the tier that the total quantity falls in.volumeThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
    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
    unit_amount_in_decimal
    The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_in_decimal
    The decimal representation of the quantity of this line_item. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    amount_in_decimal
    The decimal representation of the amount for the line_item, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.
    optional, string, max chars=33
    discount_amount
    Total discounts for this line.
    optional, in cents, min=0
    item_level_discount_amount
    Line Item-level discounts for this line.
    optional, in cents, min=0
    description
    Detailed description about this line item.
    string, max chars=250
    entity_description
    Detailed description about this item.
    string, max chars=500
    entity_type
    Specifies the modelled entity this line item 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 line item is based on. Will be null for 'adhoc' entity type.
    optional, string, max chars=100
    customer_id
    A unique identifier for the customer this line item 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 line item.
    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 line item is based 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=0
    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=0
    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
    starting_unit_in_decimal
    The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    ending_unit_in_decimal
    The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_used_in_decimal
    The decimal representation of the quantity purchased from this tier. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    unit_amount_in_decimal
    The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=40
    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
    Credit note 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 line item belongs to.
    optional, string, max chars=3
    date_from
    Start date of this line item.
    timestamp(UTC) in seconds
    date_to
    End date of this line item.
    timestamp(UTC) in seconds
    unit_amount
    Unit amount of the line item.
    in cents
    quantity
    Quantity of the recurring item which is represented by this line item.
    optional, integer, default=1
    amount
    Total amount of this line item. Typically equals to unit amount x quantity.
    optional, in cents
    pricing_model
    The pricing scheme for this item. In Product Catalog v2, the pricing scheme for this item price.
    optional, enumerated string
    Possible values are
    flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThe per unit price is based on the tier that the total quantity falls in.volumeThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
    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
    unit_amount_in_decimal
    The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_in_decimal
    The decimal representation of the quantity of this line_item. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    amount_in_decimal
    The decimal representation of the amount for the line_item, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.
    optional, string, max chars=33
    discount_amount
    Total discounts for this line.
    optional, in cents, min=0
    item_level_discount_amount
    Line Item-level discounts for this line.
    optional, in cents, min=0
    description
    Detailed description about this line item.
    string, max chars=250
    entity_description
    Detailed description about this item.
    string, max chars=500
    entity_type
    Specifies the modelled entity this line item 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 line item is based on. Will be null for 'adhoc' entity type.
    optional, string, max chars=100
    customer_id
    A unique identifier for the customer this line item 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 line item.
    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 line item is based 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=0
    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=0
    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
    starting_unit_in_decimal
    The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    ending_unit_in_decimal
    The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_used_in_decimal
    The decimal representation of the quantity purchased from this tier. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    unit_amount_in_decimal
    The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=40
    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
    End date of this charge.
    optional, timestamp(UTC) in seconds
    unit_amount
    Unit amount of the charge item.
    optional, in cents, min=0
    pricing_model
    The pricing scheme for this line item.
    optional, enumerated string
    Possible values are
    flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThe per unit price is based on the tier that the total quantity falls in.volumeThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
    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 this line item 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
    unit_amount_in_decimal
    The decimal representation of the amount for the charge, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_in_decimal
    The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    amount_in_decimal
    The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    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=0
    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=0
    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
    starting_unit_in_decimal
    The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    ending_unit_in_decimal
    The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
    optional, string, max chars=33
    quantity_used_in_decimal
    The decimal representation of the quantity purchased from this tier. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=33
    unit_amount_in_decimal
    The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
    optional, string, max chars=40

    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": 1517505710, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl2E82aS", "date": 1517505710, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWl2E82aS", "date_from": 1517505710, "date_to": 1519924910, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWl2Eq2aU", "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": 1519924910, "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 subscription billing cycles (including the first one) to invoice in advance.
    optional, integer, min=1
    billing_alignment_mode
    Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    invoice_immediately
    If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
    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 and immutable identifier for the subscription. If not provided, it is autogenerated.
    optional, string, max chars=50
    subscription[plan_unit_price_in_decimal]
    When price overriding is enabled for the site, the price or per-unit price of the plan can be set here. The value set for the plan is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    subscription[plan_quantity_in_decimal]
    The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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]
    The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately. If set to a value in the past then that date/time should not be more than a plan billing period into the past.
    optional, timestamp(UTC) in seconds
    subscription[offline_payment_method]
    The preferred offline payment method for the subscription.
    optional, enumerated string
    Possible values are
    no_preferenceNo Preference.cashCash.checkCheck.bank_transferBank Transfer.ach_creditACH Credit.sepa_creditSEPA Credit.
    subscription[free_period]
    The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit.
    optional, integer, min=1
    subscription[free_period_unit]
    The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen.
    optional, enumerated string
    Possible values are
    dayCharge based on day(s).weekCharge based on week(s).monthCharge based on month(s).yearCharge based on year(s).
    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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addon is used by default. However, the price provided here is considered as the price of the addon for an entire billing cycle of the subscription regardless of the value of the addon period. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    event_based_addons[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addon is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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__KyVnHhSBWl2XD2aV/create_subscription_estimate \
         -G  \
         -u {site_api_key}:\
    copy
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnHhSBWl2XD2aV/create_subscription_estimate \
         -G  \
         -u {site_api_key}:\

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505711, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl2XD2aV", "date": 1517505711, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWl2XD2aV", "date_from": 1517505711, "date_to": 1519924911, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWl2Yy2aZ", "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": 1519924911, "object": "subscription_estimate", "status": "active" } }}

    URL Format GET

    https://{site}.chargebee.com/api/v2/customers/{customer_id}/create_subscription_estimate
    use_existing_balances
    The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
    optional, boolean, default=true
    invoice_immediately
    If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
    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 subscription billing cycles (including the first one) to invoice in advance.
    optional, integer, min=1
    billing_alignment_mode
    Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
    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 and immutable identifier for the subscription. If not provided, it is autogenerated.
    optional, string, max chars=50
    subscription[plan_unit_price_in_decimal]
    When price overriding is enabled for the site, the price or per-unit price of the plan can be set here. The value set for the plan is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    subscription[plan_quantity_in_decimal]
    The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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]
    The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately. If set to a value in the past then that date/time should not be more than a plan billing period into the past.
    optional, timestamp(UTC) in seconds
    subscription[offline_payment_method]
    The preferred offline payment method for the subscription.
    optional, enumerated string
    Possible values are
    no_preferenceNo Preference.cashCash.checkCheck.bank_transferBank Transfer.ach_creditACH Credit.sepa_creditSEPA Credit.
    subscription[free_period]
    The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit.
    optional, integer, min=1
    subscription[free_period_unit]
    The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen.
    optional, enumerated string
    Possible values are
    dayCharge based on day(s).weekCharge based on week(s).monthCharge based on month(s).yearCharge based on year(s).
    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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addon is used by default. However, the price provided here is considered as the price of the addon for an entire billing cycle of the subscription regardless of the value of the addon period. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    event_based_addons[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addon is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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__KyVnHhSBWl3M42aj" \
         -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__KyVnHhSBWl3M42aj" \
         -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": 1517505714, "credit_note_estimates": [ { "amount_allocated": 895, "amount_available": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl3M42aj", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWl3M42aj", "date_from": 1517505714, "date_to": 1519924914, "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__KyVnHhSBWl3TH2at", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnHhSBWl3M42aj", "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__KyVnHhSBWl3M42aj", "date": 1517505714, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 1500, "customer_id": "__test__KyVnHhSBWl3M42aj", "date_from": 1517505714, "date_to": 1519924914, "description": "Plan1 - Prorated Charges", "discount_amount": 0, "entity_id": "plan1", "entity_type": "plan", "id": "li___test__KyVnHhSBWl3T72ar", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnHhSBWl3M42aj", "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__KyVnHhSBWl3M42aj", "next_billing_at": 1519924914, "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
    The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan is used. For Product Catalog v2, billing cycles set for plan-item price is used by default.
    optional, integer, min=0
    terms_to_charge
    The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge is inclusive of this new term. See description for the force_term_reset parameter to learn more about when a subscription term is reset.
    optional, integer, min=1
    reactivate_from
    When the subscription is reactivated as described under the reactivate parameter, this is the date/time at which the subscription should be reactivated.
    optional, timestamp(UTC) in seconds
    billing_alignment_mode
    Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
    coupon_ids[0..n]
    List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
    optional, list of string
    replace_coupon_list
    If true then the existing coupon_ids list for the subscription is replaced by the one provided. If false then the provided list gets added to the existing coupon_ids.
    optional, boolean
    prorate
    Raise prorated credits or charges as applicable while changing the subscription. When not provided, the value is taken from the site settings.
    optional, boolean
    end_of_term
    Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
    optional, boolean
    force_term_reset
    Say the subscription has the renewal date as 28th of every month. When the plan-item price of the subscription is set to one that has the same billing period as the current plan-item price, the subscription change does not change the term. In other words, the subscription still renews on the 28th. Passing this parameter as true will have the subscription reset its term to the current date (provided end_of_term is false).
    Note: When the new plan-item price has a billing period different from the current plan-item price of the subscription, the term is always reset, regardless of the value passed for this parameter.
    optional, boolean, default=false
    reactivate
    Applicable only for cancelled subscriptions. When passed as true, the canceled subscription is activated; otherwise subscription changes are made without changing its status. If not passed, subscription will be activated only if subscription_items is passed.
    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
    The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
    optional, boolean, default=true
    invoice_immediately
    If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
    optional, boolean
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
    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[plan_quantity_in_decimal]
    The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    subscription[plan_unit_price_in_decimal]
    When price overriding is enabled for the site, the price or per-unit price of the plan can be set here. The value set for the plan is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    subscription[start_date]
    The new start date of a future subscription. Applicable only for future subscriptions.
    optional, timestamp(UTC) in seconds
    subscription[trial_end]
    End of the trial period for the subscription. This overrides the trial period set for the plan. In Product Catalog v2 this overrides trial period set for the plan-item. Set it to 0 to have no trial period.
    optional, timestamp(UTC) in seconds
    subscription[auto_collection]
    Defines whether payments need to be collected automatically for this subscription. Overrides customer's auto-collection property.
    optional, enumerated string
    Possible values are
    onWhenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.offAutomatic collection of charges will not be made for this subscription. Use this for offline payments.
    subscription[offline_payment_method]
    The preferred offline payment method for the subscription.
    optional, enumerated string
    Possible values are
    no_preferenceNo Preference.cashCash.checkCheck.bank_transferBank Transfer.ach_creditACH Credit.sepa_creditSEPA Credit.
    subscription[free_period]
    The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit.
    optional, integer, min=1
    subscription[free_period_unit]
    The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the period_unit attribute of the plan chosen.
    optional, enumerated string
    Possible values are
    dayCharge based on day(s).weekCharge based on week(s).monthCharge based on month(s).yearCharge based on year(s).
    +
    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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    addons[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addon is used by default. However, the price provided here is considered as the price of the addon for an entire billing cycle of the subscription regardless of the value of the addon period. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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
    event_based_addons[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    event_based_addons[unit_price_in_decimal][0..n]
    When price overriding is enabled for the site, the price or per-unit price of the addon can be set here. The value set for the addonis used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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__KyVnHhSBWkzpS2Zo/renewal_estimate \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnHhSBWkzpS2Zo/renewal_estimate \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505701, "invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWkzpS2Zo", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWkzpS2Zo", "date_from": 1519924901, "date_to": 1522603301, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWkzv72Zv", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnHhSBWkzpS2Zo", "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__KyVnHhSBWkzpS2Zo", "next_billing_at": 1519924901, "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
    The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don’t want these balances to be included you can specify 'false' for the parameter use_existing_balances.
    optional, boolean, 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
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVkjcSAl6gBw1/advance_invoice_estimate \
         -u {site_api_key}:\
         -d invoice_immediately="false" \
         -d terms_to_charge=3
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVkjcSAl6gBw1/advance_invoice_estimate \
         -u {site_api_key}:\
         -d invoice_immediately="false" \
         -d terms_to_charge=3

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517492806, "object": "estimate", "unbilled_charge_estimates": [ { "amount": 895, "currency_code": "USD", "customer_id": "__test__KyVkjcSAl6gBw1", "date_from": 1519912004, "date_to": 1522590404, "deleted": false, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVkjcSAl6gcKF", "is_voided": false, "object": "unbilled_charge", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVkjcSAl6gBw1", "unit_amount": 895 }, {..} ] }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/advance_invoice_estimate
    terms_to_charge
    • For schedule_type = immediate: the number of future billing cycles to be invoiced in advance. The invoicing is done for the remaining_billing_cycles of the subscription if that is less than terms_to_charge.
    • For schedule_type = fixed_intervals: The number of future billing cycles in one interval. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles of the subscription.
    .
    optional, integer, default=1, min=1
    invoice_immediately
    Whether the charge should be invoiced immediately or added to unbilled_charges. Applicable only when schedule_type is immediate.
    optional, boolean
    schedule_type
    The type of advance invoice or advance invoicing schedule.
    optional, enumerated string
    Possible values are
    immediateCharge immediately for the number of billing cycles specified by terms_to_charge.specific_datesCharge on specific dates. For each date, specify the number of billing cycles to charge for. Up to 5 dates can be configured.fixed_intervalsCharge at fixed intervals of time. Specify the number of billing cycles that constitute an interval and the number of days before each interval that the invoice should be generated. Also specify when the schedule should end.
    +
    fixed_interval_schedule
    Parameters for fixed_interval_schedule
    pass parameters as fixed_interval_schedule[<param name>]
    fixed_interval_schedule[number_of_occurrences]
    The number of advance invoices to generate. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles of the subscription. This parameter is applicable only when fixed_interval_schedule[end_schedule_on] = after_number_of_intervals.
    optional, integer, min=1
    fixed_interval_schedule[days_before_renewal]
    The number of days before each interval that advance invoices are generated.
    optional, integer, min=1
    fixed_interval_schedule[end_schedule_on]
    Specifies when the schedule should end.
    optional, enumerated string
    Possible values are
    after_number_of_intervalsAdvance invoices are generated a specified number of times.specific_dateEnd the advance invoicing schedule on a specific date.subscription_endAdvance invoices are generated for as long as the subscription is active.
    fixed_interval_schedule[end_date]
    The date when the schedule should end. Advance invoices are not generated beyond this date. It must be at least 1 day before the start of the last billing cycle of the subscription and also within 5 years from the current date. This parameter is only applicable when fixed_interval_schedule[end_schedule_on] = specific_date.
    optional, timestamp(UTC) in seconds
    +
    specific_dates_schedule
    Parameters for specific_dates_schedule. Multiple specific_dates_schedule can be passed by specifying unique indices.
    pass parameters as specific_dates_schedule[<param name>][<idx:0..n>]
    specific_dates_schedule[terms_to_charge][0..n]
    The number of billing cycles to charge for, on the date specified. Applicable only when schedule_type is specific_dates.
    optional, integer
    specific_dates_schedule[date][0..n]
    The unique id of the member of the advance_invoice_schedule array which corresponds to the specific_dates_schedule that you intend to modify. Only applicable when schedule_type is specific_dates.
    optional, timestamp(UTC) in seconds
    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__KyVnHhSBWl2pw2aa/upcoming_invoices_estimate \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVnHhSBWl2pw2aa/upcoming_invoices_estimate \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505713, "invoice_estimates": [ { "amount_due": 1790, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl2pw2aa", "date": 1517505713, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWl2pw2aa", "date_from": 1517505712, "date_to": 1519924912, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWl2rW2ac", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnHhSBWl2pw2aa", "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__KyVnHhSBWkzRq2Zh/change_term_end_estimate \
         -u {site_api_key}:\
         -d term_ends_at=1566697500
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnHhSBWkzRq2Zh/change_term_end_estimate \
         -u {site_api_key}:\
         -d term_ends_at=1566697500

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505699, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnHhSBWkzRq2Zh", "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
    If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings.
    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__KyVnHhSBWkz4Y2Za/cancel_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d end_of_term="true"
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnHhSBWkz4Y2Za/cancel_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d end_of_term="true"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505698, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnHhSBWkz4Y2Za", "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__KyVnHhSBWl1SO2aC/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__KyVnHhSBWl1SO2aC/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": 1517505707, "credit_note_estimates": [], "object": "estimate", "subscription_estimate": { "currency_code": "USD", "id": "__test__KyVnHhSBWl1SO2aC", "next_billing_at": 1519924907, "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]
    When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the paused state, it is the date/time when the subscription was paused.
    optional, timestamp(UTC) in seconds
    subscription[resume_date]
    For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
    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__KyVnHhSBWl1p52aJ/resume_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d resume_option="immediately"
    copy
    curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__KyVnHhSBWl1p52aJ/resume_subscription_estimate \
         -X POST  \
         -u {site_api_key}:\
         -d resume_option="immediately"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505709, "next_invoice_estimate": { "amount_due": 895, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl1p52aJ", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "customer_id": "__test__KyVnHhSBWl1p52aJ", "date_from": 1519924908, "date_to": 1522603308, "description": "No Trial", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__KyVnHhSBWl1wp2aR", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__KyVnHhSBWl1p52aJ", "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__KyVnHhSBWl1p52aJ", "next_billing_at": 1519924908, "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]
    For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
    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": 1517505706, "invoice_estimate": { "amount_due": 10000, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "gifter", "date": 1517505705, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 10000, "customer_id": "gifter", "date_from": 1612200110, "date_to": 1614619310, "description": "New Year Gift", "discount_amount": 0, "entity_id": "GiftPlan$100", "entity_type": "plan", "id": "li___test__KyVnHhSBWl16u2a9", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "subscription_id": "__test__KyVnHhSBWl15j2a7", "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__KyVnHhSBWl15j2a7", "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
    subscription[plan_quantity_in_decimal]
    The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    +
    shipping_address
    Parameters for shipping_address
    pass parameters as shipping_address[<param name>]
    shipping_address[first_name]
    The first name of the contact.
    optional, string, max chars=150
    shipping_address[last_name]
    The last name of the contact.
    optional, string, max chars=150
    shipping_address[email]
    The email address.
    optional, string, max chars=70
    shipping_address[company]
    The company name.
    optional, string, max chars=250
    shipping_address[phone]
    The 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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    shipping_address[state]
    The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Can be provided for quantity-based plans and only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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__KyVnHhSBWl0D02Zw" \
         -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__KyVnHhSBWl0D02Zw" \
         -d charges[amount][0]=1000 \
         -d charges[description][0]="Adhoc charge"

    Sample Response [ JSON ]

    Show more...
    {"estimate": { "created_at": 1517505702, "invoice_estimate": { "amount_due": 1000, "amount_paid": 0, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__KyVnHhSBWl0D02Zw", "date": 1517505702, "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 1000, "customer_id": "__test__KyVnHhSBWl0D02Zw", "date_from": 1517505702, "date_to": 1517505702, "description": "Adhoc charge", "discount_amount": 0, "entity_type": "adhoc", "id": "li___test__KyVnHhSBWl0F22Zz", "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]
    The first name of the contact.
    optional, string, max chars=150
    shipping_address[last_name]
    The last name of the contact.
    optional, string, max chars=150
    shipping_address[email]
    The email address.
    optional, string, max chars=70
    shipping_address[company]
    The company name.
    optional, string, max chars=250
    shipping_address[phone]
    The 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]
    The name of the 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 state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
    optional, string, max chars=50
    shipping_address[state]
    The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
    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[quantity_in_decimal][0..n]
    The decimal representation of the quantity of the addon. Returned for quantity-based plans when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[unit_price_in_decimal][0..n]
    The decimal representation of the price or per-unit price of the addon. The value is in major units of the currency. Always returned when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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[amount_in_decimal][0..n]
    The decimal representation of the amount for the one-time charge. Provide the value in major units of the currency. Can be provided only when multi-decimal pricing is enabled.
    optional, string, max chars=33
    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