API Version
Product Catalog
Library

A quote is an estimate of the invoice with the charges likely to occur when customers buy an item. A quote can be converted to a regular invoice once the customer accepts it.

The line items of a quote are grouped by charge events and are available as a separate resource. This resource can be retrieved using the List quote line groups endpoint. Note that the first quote line group is available within the quote resource itself and parsing the quote line groups object is not required.

Sample quote [ JSON ]

{ "amount_due": 4500, "amount_paid": 0, "billing_address": { "first_name": "John", "last_name": "Doe", "object": "billing_address", "validation_status": "not_validated" }, "charge_on_acceptance": 4500, "credits_applied": 0, "currency_code": "USD", "customer_id": "__test__8aszcSOcl7qp2S", "date": 1517494517, "id": "8", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 4000, "customer_id": "__test__8aszcSOcl7qp2S", "date_from": 1517494517, "date_to": 1517494517, "description": "Encryption Charge USD Monthly", "discount_amount": 0, "entity_id": "encryption-charge-USD", "entity_type": "charge_item_price", "id": "__test__8aszcSOcl7z92d", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "tax_amount": 0, "unit_amount": 4000 }, { "amount": 500, "customer_id": "__test__8aszcSOcl7qp2S", "date_from": 1517494517, "date_to": 1517494517, "description": "SSL Charge USD Monthly", "discount_amount": 0, "entity_id": "ssl-charge-USD", "entity_type": "charge_item_price", "id": "__test__8aszcSOcl7z92e", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "tax_amount": 0, "unit_amount": 500 } ], "object": "quote", "operation_type": "onetime_invoice", "price_type": "tax_exclusive", "resource_version": 1517494517214, "status": "open", "sub_total": 4500, "taxes": [], "total": 4500, "total_payable": 4500, "updated_at": 1517494517, "valid_till": 1526134516, "version": 1 }

API Index URL

https://{site}.chargebee.com/api/v2/quotes

Model Class

id
string, max chars=50

The quote number. Acts as a identifier for quote and typically generated sequentially.


name
optional, string, max chars=100

The quote name will be used as the pdf name of the quote.


po_number
optional, string, max chars=100

Purchase Order Number


customer_id
string, max chars=50

The identifier of the customer this quote belongs to.


subscription_id
optional, string, max chars=50

The identifier of the subscription this quote belongs to.


invoice_id
optional, string, max chars=50

The identifier of the invoice generated while converting this quote.


status
enumerated string

Current status of this quote.


Possible values are
open

The quote is either newly created, or has been approved but not yet sent to the customer.

accepted

The customer has accepted the quote.

declined

The customer declined/rejected the quote.

invoiced

The accepted quote has been converted into a subscription or one-time charge and invoiced through Chargebee.

Show all values[+]
operation_type
enumerated string

Operation Type


Possible values are
create_subscription_for_customer

create_subscription_for_customer

change_subscription

change_subscription

onetime_invoice

onetime_invoice

renew_subscription
Show all values[+]
vat_number
optional, string, max chars=20

VAT/ Tax registration number of the customer. Learn more


price_type
enumerated string, default=tax_exclusive

The price type of the quote.


Possible values are
tax_exclusive

All amounts in the document are exclusive of tax.

tax_inclusive

All amounts in the document are inclusive of tax.

Show all values[+]
valid_till
timestamp(UTC) in seconds

Quote will be valid till this date. After this date quote will be marked as closed.


date
timestamp(UTC) in seconds

Creation date of the quote. Typically this is the date on which quote is generated.


total_payable
optional, in cents, min=0

Total contract value. Applicable when multi billing cycle quote is enabled.


charge_on_acceptance
optional, in cents, default=0, min=0

Charge on acceptance. Applicable when multi billing cycle quote is enabled.


sub_total
in cents, min=0

Subtotal (in cents) of the first quote line group.


total
optional, in cents, default=0, min=0

Total (in cents) of the first quote line group.


credits_applied
optional, in cents, default=0, min=0

Credits applied (in cents) for the first quote line group.


amount_paid
optional, in cents, default=0, min=0

Existing outstanding payments (in cents) if any, applied to the first quote line group.


amount_due
optional, in cents, default=0, min=0

Amount due (in cents) for the first quote line group.


version
optional, integer, default=1

Version of the quote.


resource_version
optional, long

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


updated_at
optional, timestamp(UTC) in seconds

Timestamp indicating when this quote was last updated.


vat_number_prefix
optional, string, max chars=10

An overridden value for the first two characters of the full VAT number. Only applicable specifically for customers with billing_address

country as XI (which is United Kingdom - Northern Ireland ).

When you have enabled EU VAT in 2021 or have manually enabled the Brexit configuration, you have the option of setting billing_address

country as XI. That's the code for United Kingdom - Northern Ireland. The first two characters of the VAT number in such a case is XI by default. However, if the VAT number was registered in UK, the value should be GB. Set vat_number_prefix to GB for such cases.


tax_category
optional, string

Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.


currency_code
string, max chars=3

The currency code (ISO 4217 format) of the quote.


notes
optional

List of notes associated with this quotes.


contract_term_start
optional, timestamp(UTC) in seconds

Specifies the contract term's start date.


contract_term_end
optional, timestamp(UTC) in seconds

Specifies the contract term's end date. It indicates when the action set in action_at_term_end gets triggered.


contract_term_termination_fee
optional, in cents, min=0

Specifies the charge to be applied for terminating the contract term.


business_entity_id
optional, string, max chars=50

The unique ID of the business entity of this quote.


deleted
boolean

Indicates that this resource has been deleted when the value is true .


total_contract_value
optional, in cents, min=0

The total contract value of the quote.

Note: This parameter applies only when Chargebee CPQ is enabled. To request access, please contact support@chargebee.com


total_discount
optional, in cents, min=0

The total discount value of the quote for the contract period.

Note: This parameter applies only when Chargebee CPQ is enabled. To request access, please contact support@chargebee.com


optional, list of line_item

The list of line items for this quote.

line_item_tiers
Show attributes [+]
optional, list of line_item_tier

The list of tiers applicable for the various line items in this quote.

line_item_discounts
Show attributes [+]
optional, list of line_item_discount

The list of deductions applied for each line item of this quote.

line_item_taxes
Show attributes [+]
optional, list of line_item_tax

The list of taxes applied on the line items of this quote.

optional, list of discount

The list of all deductions applied to the quote.

optional, list of tax

The list of taxes applicable for this quote.

shipping_address
Show attributes [+]
optional, shipping_address

Shipping address for the quote.

billing_address
Show attributes [+]
optional, billing_address

Billing address for the quote.

id id
string, max chars=50

The quote number. Acts as a identifier for quote and typically generated sequentially.


name name
optional, string, max chars=100

The quote name will be used as the pdf name of the quote.


po_number po_number
optional, string, max chars=100

Purchase Order Number


customer_id customer_id
string, max chars=50

The identifier of the customer this quote belongs to.


subscription_id subscription_id
optional, string, max chars=50

The identifier of the subscription this quote belongs to.


invoice_id invoice_id
optional, string, max chars=50

The identifier of the invoice generated while converting this quote.


status status
enumerated string

Current status of this quote.


Possible values are
open

The quote is either newly created, or has been approved but not yet sent to the customer.

accepted

The customer has accepted the quote.

declined

The customer declined/rejected the quote.

invoiced

The accepted quote has been converted into a subscription or one-time charge and invoiced through Chargebee.

Show all values[+]
operation_type operation_type
enumerated string

Operation Type


Possible values are
create_subscription_for_customer

create_subscription_for_customer

change_subscription

change_subscription

onetime_invoice

onetime_invoice

renew_subscription
Show all values[+]
vat_number vat_number
optional, string, max chars=20

VAT/ Tax registration number of the customer. Learn more


price_type price_type
enumerated string, default=tax_exclusive

The price type of the quote.


Possible values are
tax_exclusive

All amounts in the document are exclusive of tax.

tax_inclusive

All amounts in the document are inclusive of tax.

Show all values[+]
valid_till valid_till
timestamp(UTC) in seconds

Quote will be valid till this date. After this date quote will be marked as closed.


date date
timestamp(UTC) in seconds

Creation date of the quote. Typically this is the date on which quote is generated.


total_payable total_payable
optional, in cents, min=0

Total contract value. Applicable when multi billing cycle quote is enabled.


charge_on_acceptance charge_on_acceptance
optional, in cents, default=0, min=0

Charge on acceptance. Applicable when multi billing cycle quote is enabled.


sub_total sub_total
in cents, min=0

Subtotal (in cents) of the first quote line group.


total total
optional, in cents, default=0, min=0

Total (in cents) of the first quote line group.


credits_applied credits_applied
optional, in cents, default=0, min=0

Credits applied (in cents) for the first quote line group.


amount_paid amount_paid
optional, in cents, default=0, min=0

Existing outstanding payments (in cents) if any, applied to the first quote line group.


amount_due amount_due
optional, in cents, default=0, min=0

Amount due (in cents) for the first quote line group.


version version
optional, integer, default=1

Version of the quote.


resource_version resource_version
optional, long

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


updated_at updated_at
optional, timestamp(UTC) in seconds

Timestamp indicating when this quote was last updated.


vat_number_prefix vat_number_prefix
optional, string, max chars=10

An overridden value for the first two characters of the full VAT number. Only applicable specifically for customers with billing_address

country as XI (which is United Kingdom - Northern Ireland ).

When you have enabled EU VAT in 2021 or have manually enabled the Brexit configuration, you have the option of setting billing_address

country as XI. That's the code for United Kingdom - Northern Ireland. The first two characters of the VAT number in such a case is XI by default. However, if the VAT number was registered in UK, the value should be GB. Set vat_number_prefix to GB for such cases.


tax_category tax_category
optional, string

Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.


currency_code currency_code
string, max chars=3

The currency code (ISO 4217 format) of the quote.


notes notes
optional

List of notes associated with this quotes.


contract_term_start contract_term_start
optional, timestamp(UTC) in seconds

Specifies the contract term's start date.


contract_term_end contract_term_end
optional, timestamp(UTC) in seconds

Specifies the contract term's end date. It indicates when the action set in action_at_term_end gets triggered.


contract_term_termination_fee contract_term_termination_fee
optional, in cents, min=0

Specifies the charge to be applied for terminating the contract term.


business_entity_id business_entity_id
optional, string, max chars=50

The unique ID of the business entity of this quote.


deleted deleted
boolean

Indicates that this resource has been deleted when the value is true .


total_contract_value total_contract_value
optional, in cents, min=0

The total contract value of the quote.

Note: This parameter applies only when Chargebee CPQ is enabled. To request access, please contact support@chargebee.com


total_discount total_discount
optional, in cents, min=0

The total discount value of the quote for the contract period.

Note: This parameter applies only when Chargebee CPQ is enabled. To request access, please contact support@chargebee.com


line_items
optional, list of line_item

The list of line items for this quote.


line_item_tiers
optional, list of line_item_tier

The list of tiers applicable for the various line items in this quote.


line_item_discounts
optional, list of line_item_discount

The list of deductions applied for each line item of this quote.


line_item_taxes
optional, list of line_item_tax

The list of taxes applied on the line items of this quote.


discounts
optional, list of discount

The list of all deductions applied to the quote.


taxes
optional, list of tax

The list of taxes applicable for this quote.


shipping_address
optional, shipping_address

Shipping address for the quote.


billing_address
optional, billing_address

Billing address for the quote.


Try in API Explorer

Retrieves the quotes identified by the 'number' specified in the url.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/8 \
     -u {site_api_key}:
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 4500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 4500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl7qp2S",
        "date": 1517494517,
        "id": "8",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl7qp2S",
                "date_from": 1517494517,
                "date_to": 1517494517,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__8aszcSOcl7z92d",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 4000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517494517214,
        "status": "open",
        "sub_total": 4500,
        "taxes": [],
        "total": 4500,
        "total_payable": 4500,
        "updated_at": 1517494517,
        "valid_till": 1526134516,
        "version": 1
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/quotes/{quote-id}

Method

quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_charge quoted_charge
optional
Resource object representing quoted_charge
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Create a quote for new subscription line items of a customer.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/customers/__test__KyVkhnS3NssjH7/create_subscription_quote_for_items \
     -X POST  \
     -u {site_api_key}:\
     -d "subscription_items[item_price_id][0]"="basic-USD" \
     -d "subscription_items[quantity][0]"=1 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 1000,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 0,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVkhnS3NssjH7",
        "date": 1517475933,
        "id": "1",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 1000,
                "customer_id": "__test__KyVkhnS3NssjH7",
                "date_from": 1517475933,
                "date_to": 1519895133,
                "description": "basic USD",
                "discount_amount": 0,
                "entity_id": "basic-USD",
                "entity_type": "plan_item_price",
                "id": "__test__KyVkhnS3NstZzH",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "per_unit",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 1000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "create_subscription_for_customer",
        "price_type": "tax_exclusive",
        "resource_version": 1517475934000,
        "status": "open",
        "sub_total": 1000,
        "taxes": [],
        "total": 1000,
        "updated_at": 1517475934,
        "valid_till": 1517596199,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer-id}/create_subscription_quote_for_items

Method

name[]
optional, string, max chars=100

The quote name will be used as the pdf name of the quote.

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

billing_cycles[]
optional, integer, min=0

The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used.

mandatory_items_to_remove[[0..n]][0..n]
optional, list of string

Item ids of mandatorily attached addons that are to be removed from the subscription.

terms_to_charge[]
optional, integer, min=1

The number of subscription billing cycles (including the first one) to invoice in advance .

billing_alignment_mode[]
optional, enumerated string

Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site.

Possible values are
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

Show all values[+]
coupon_ids[[0..n]][0..n]
optional, list of string

The list of IDs of the coupons to be applied. Coupon codes are also supported.

Note

Not applicable when Chargebee CPQ is enabled. Use coupons[] array instead.

billing_start_option[]
optional, enumerated string, default=on_specific_date

When the quote is converted, this attribute determines the date/time as of when the subscription start is to be carried out.

Note

The parameter applies only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

Possible values are
immediately

The subscription starts immediately upon conversion of the quote to a subscription.

on_specific_date

Upon quote conversion, the subscription is scheduled to start on the specified date.

Show all values[+]
net_term_days[]
optional, integer

The number of days within which the customer has to make payment for the invoice.

Note

The parameter applies only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

subscription[id]
optional, string, max chars=50
subscription[po_number]
optional, string, max chars=100
subscription[trial_end]
optional, timestamp(UTC) in seconds
subscription[start_date]
optional, timestamp(UTC) in seconds
subscription[offline_payment_method]
optional, enumerated string
Possible values are
no_preference

No Preference

cash

Cash

check

Check

bank_transfer

Bank Transfer

Show all values[+]
subscription[contract_term_billing_cycle_on_renewal]
optional, integer, min=1, max=100
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
contract_term[action_at_term_end]
optional, enumerated string
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.
evergreen

Contract term completes and the subscription renews.

cancel

Contract term completes and subscription is canceled.

Show all values[+]
contract_term[cancellation_cutoff_period]
optional, integer, default=0
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
subscription_items[item_price_id][0..n]
required, string, max chars=100
subscription_items[quantity][0..n]
optional, integer, min=1
subscription_items[quantity_in_decimal][0..n]
optional, string, max chars=33
subscription_items[unit_price][0..n]
optional, in cents, min=0
subscription_items[unit_price_in_decimal][0..n]
optional, string, max chars=39
subscription_items[billing_cycles][0..n]
optional, integer, min=0
subscription_items[trial_end][0..n]
optional, timestamp(UTC) in seconds
subscription_items[service_period_days][0..n]
optional, integer, min=1, max=730
subscription_items[charge_on_event][0..n]
optional, enumerated string
Possible values are
subscription_creation

the time of creation of the subscription.

subscription_trial_start

the time when the trial period of the subscription begins.

plan_activation

same as subscription activation, but also includes the case when the plan-item of the subscription is changed.

subscription_activation

the moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.

Show all values[+]
subscription_items[charge_once][0..n]
optional, boolean
subscription_items[charge_on_option][0..n]
optional, enumerated string
Possible values are
immediately

The item is charged immediately on being added to the subscription.

on_event

The item is charged at the occurrence of the event specified as charge_on_event .

Show all values[+]
subscription_items[start_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[end_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[ramp_tier_id][0..n]
optional, string, max chars=105
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[duration_type][0..n]
required, enumerated string, default=forever
Possible values are
one_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit .

Show all values[+]
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[start_date][0..n]
optional, timestamp(UTC) in seconds
discounts[end_date][0..n]
optional, timestamp(UTC) in seconds
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
item_tiers[ramp_tier_id][0..n]
optional, string, max chars=105
coupons[id][0..n]
optional, string, max chars=100
coupons[start_date][0..n]
optional, timestamp(UTC) in seconds
coupons[end_date][0..n]
optional, timestamp(UTC) in seconds
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Changes the quote produced for creating a new subscription items

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/4/edit_create_subscription_quote_for_items \
     -X POST  \
     -u {site_api_key}:\
     -d "subscription_items[item_price_id][0]"="basic-USD" \
     -d "subscription_items[unit_price][0]"=1520 \
     -d "subscription_items[quantity][0]"=3 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 4560,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 0,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVlFpS4cWDaQi",
        "date": 1517485108,
        "id": "4",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4560,
                "customer_id": "__test__KyVlFpS4cWDaQi",
                "date_from": 1517485108,
                "date_to": 1519904308,
                "description": "basic USD",
                "discount_amount": 0,
                "entity_id": "basic-USD",
                "entity_type": "plan_item_price",
                "id": "__test__KyVlFpS4cWDxA10",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "per_unit",
                "quantity": 3,
                "tax_amount": 0,
                "unit_amount": 1520
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "create_subscription_for_customer",
        "price_type": "tax_exclusive",
        "resource_version": 1517485108000,
        "status": "open",
        "sub_total": 4560,
        "taxes": [],
        "total": 4560,
        "updated_at": 1517485108,
        "valid_till": 1517596199,
        "version": 2
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/edit_create_subscription_quote_for_items

Method

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

billing_cycles[]
optional, integer, min=0

The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used.

mandatory_items_to_remove[[0..n]][0..n]
optional, list of string

Item ids of mandatorily attached addons that are to be removed from the subscription.

terms_to_charge[]
optional, integer, min=1

The number of subscription billing cycles (including the first one) to invoice in advance .

billing_alignment_mode[]
optional, enumerated string

Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site.

Possible values are
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

Show all values[+]
coupon_ids[[0..n]][0..n]
optional, list of string

The list of IDs of the coupons to be applied. Coupon codes are also supported.

Note

Not applicable when Chargebee CPQ is enabled. Use coupons[] array instead.

billing_start_option[]
optional, enumerated string, default=on_specific_date

When the quote is converted, this attribute determines the date/time as of when the subscription start is to be carried out.

Note

The parameter applies only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

Possible values are
immediately

The subscription starts immediately upon conversion of the quote to a subscription.

on_specific_date

Upon quote conversion, the subscription is scheduled to start on the specified date.

Show all values[+]
net_term_days[]
optional, integer

The number of days within which the customer has to make payment for the invoice.

Note The parameter applies only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

subscription[id]
optional, string, max chars=50
subscription[po_number]
optional, string, max chars=100
subscription[trial_end]
optional, timestamp(UTC) in seconds
subscription[start_date]
optional, timestamp(UTC) in seconds
subscription[offline_payment_method]
optional, enumerated string
Possible values are
no_preference

No Preference

cash

Cash

check

Check

bank_transfer

Bank Transfer

Show all values[+]
subscription[contract_term_billing_cycle_on_renewal]
optional, integer, min=1, max=100
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
contract_term[action_at_term_end]
optional, enumerated string
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.
evergreen

Contract term completes and the subscription renews.

cancel

Contract term completes and subscription is canceled.

Show all values[+]
contract_term[cancellation_cutoff_period]
optional, integer, default=0
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
subscription_items[item_price_id][0..n]
required, string, max chars=100
subscription_items[quantity][0..n]
optional, integer, min=1
subscription_items[quantity_in_decimal][0..n]
optional, string, max chars=33
subscription_items[unit_price][0..n]
optional, in cents, min=0
subscription_items[unit_price_in_decimal][0..n]
optional, string, max chars=39
subscription_items[billing_cycles][0..n]
optional, integer, min=0
subscription_items[trial_end][0..n]
optional, timestamp(UTC) in seconds
subscription_items[service_period_days][0..n]
optional, integer, min=1, max=730
subscription_items[charge_on_event][0..n]
optional, enumerated string
Possible values are
subscription_creation

the time of creation of the subscription.

subscription_trial_start

the time when the trial period of the subscription begins.

plan_activation

same as subscription activation, but also includes the case when the plan-item of the subscription is changed.

subscription_activation

the moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.

Show all values[+]
subscription_items[charge_once][0..n]
optional, boolean
subscription_items[charge_on_option][0..n]
optional, enumerated string
Possible values are
immediately

The item is charged immediately on being added to the subscription.

on_event

The item is charged at the occurrence of the event specified as charge_on_event .

Show all values[+]
subscription_items[start_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[end_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[ramp_tier_id][0..n]
optional, string, max chars=105
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[duration_type][0..n]
required, enumerated string, default=forever
Possible values are
one_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit .

Show all values[+]
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[start_date][0..n]
optional, timestamp(UTC) in seconds
discounts[end_date][0..n]
optional, timestamp(UTC) in seconds
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
item_tiers[ramp_tier_id][0..n]
optional, string, max chars=105
coupons[id][0..n]
optional, string, max chars=100
coupons[start_date][0..n]
optional, timestamp(UTC) in seconds
coupons[end_date][0..n]
optional, timestamp(UTC) in seconds
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Create a quote for updating subscription line items.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/update_subscription_quote_for_items \
     -u {site_api_key}:\
     -d "subscription[id]"="__test__KyVlFpS4cWD9fW" \
     -d "billing_address[first_name]"="John" \
     -d "billing_address[last_name]"="Doe" \
     -d "billing_address[line1]"="PO Box 9999" \
     -d "billing_address[city]"="Walnut" \
     -d "billing_address[state]"="California" \
     -d "billing_address[zip]"="91789" \
     -d "billing_address[country]"="US" \
     -d "subscription_items[item_price_id][0]"="basic-USD" \
     -d "subscription_items[quantity][0]"=2 \
     -d "subscription_items[unit_price][0]"=1000 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 1000,
        "amount_paid": 0,
        "billing_address": {
            "city": "Walnut",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe",
            "line1": "PO Box 9999",
            "object": "billing_address",
            "state": "California",
            "validation_status": "not_validated",
            "zip": "91789"
        },
        "charge_on_acceptance": 0,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVlFpS4cWD2iU",
        "date": 1517485106,
        "id": "3",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 1000,
                "customer_id": "__test__KyVlFpS4cWD2iU",
                "date_from": 1517485106,
                "date_to": 1519904305,
                "description": "basic USD - Prorated Charges",
                "discount_amount": 0,
                "entity_id": "basic-USD",
                "entity_type": "plan_item_price",
                "id": "__test__KyVlFpS4cWDW2g",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "per_unit",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 1000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "change_subscription",
        "price_type": "tax_exclusive",
        "resource_version": 1517485106000,
        "status": "open",
        "sub_total": 1000,
        "subscription_id": "__test__KyVlFpS4cWD9fW",
        "taxes": [],
        "total": 1000,
        "updated_at": 1517485106,
        "valid_till": 1517596199,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/update_subscription_quote_for_items

Method

name[]
optional, string, max chars=100

The quote name will be used as the pdf name of the quote.

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

mandatory_items_to_remove[[0..n]][0..n]
optional, list of string

Item ids of mandatorily attached addons that are to be removed from the subscription.

replace_items_list[]
optional, boolean, default=false

If true then the existing subscription_items list for the subscription is replaced by the one provided. If false then the provided subscription_items list gets added to the existing list.

billing_cycles[]
optional, integer, min=0

Billing cycles set for plan-item price is used by default.

terms_to_charge[]
optional, integer, min=1

The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge is inclusive of this new term. See description for the force_term_reset parameter to learn more about when a subscription term is reset.

reactivate_from[]
optional, timestamp(UTC) in seconds

If the subscription status is cancelled and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated. Note: It is recommended not to pass this parameter along with changed_scheduled_at. reactivate_from can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:

  • Backdating must be enabled for subscription reactivation operations.
  • The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
  • The date is on or after the last date/time any of the product catalog items of the subscription were changed.
  • The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April, changes_scheduled_at cannot be earlier than 14th February. .
billing_alignment_mode[]
optional, enumerated string

Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.

Possible values are
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

Show all values[+]
coupon_ids[[0..n]][0..n]
optional, list of string

The list of IDs of the coupons to be applied. Coupon codes are also supported.

Note

Not applicable when Chargebee CPQ is enabled. Use coupons[] array instead.

replace_coupon_list[]
optional, boolean, default=false

Should be true if the existing coupons should be replaced with the ones that are being passed.

change_option[]
optional, enumerated string

When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out.

Possible values are
immediately

The change is carried out immediately.

specific_date

The change is carried out as of the date specified under changes_scheduled_at .

Show all values[+]
changes_scheduled_at[]
optional, timestamp(UTC) in seconds

When change_option is set to specific_date , then set the date/time at which the subscription change is to happen or has happened. changes_scheduled_at can be set to a value in the past. This is called backdating the subscription change and is performed when the subscription change has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:

  • Backdating must be enabled for subscription change operations.

  • Only the following changes can be backdated:

  • Changes in the recurring items or their prices.

  • Addition of non-recurring items.

  • Subscription status is active, cancelled, or non_renewing.

  • The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.

  • The date is on or after current_term_start.

  • The date is on or after the last date/time any of the following changes were made:

  • Changes in the recurring items or their prices.

  • Addition of non-recurring items.

  • The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, changes_scheduled_at cannot be earlier than 14th February..

Note: The changes_scheduled_at parameter does not apply to auto_collection , shipping_address , and po_number ; these parameters take effect immediately when scheduling a subscription update.

force_term_reset[]
optional, boolean, default=false

Applicable for 'Active' & 'Non Renewing' states alone. Generally, subscription's term will be reset (i.e current term is ended and a new term starts immediately) when a new plan having different billing frequency is specified in the input. For all the other cases, the subscription's term will remain intact. Now for this later scenario, if you want to force a term reset you can specify this param as 'true'. Note: Specifying this value as 'false' has no impact on the default behaviour.

reactivate[]
optional, boolean

Applicable only for cancelled subscriptions. Once this is passed as true, cancelled subscription will become active; otherwise subscription changes will be made but the subscription state will remain cancelled. If not passed, subscription will be activated only if there is any change in subscription data.

net_term_days[]
optional, integer

The number of days within which the customer has to make payment for the invoice.

Note: This parameter applies only when Chargebee CPQ is enabled. To request access, please contact support@chargebee.com

subscription[id]
required, string, max chars=50
subscription[start_date]
optional, timestamp(UTC) in seconds
subscription[trial_end]
optional, timestamp(UTC) in seconds
subscription[auto_collection]
optional, enumerated string
Possible values are
on

Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.

off

Automatic collection of charges will not be made for this subscription. Use this for offline payments.

Show all values[+]
subscription[offline_payment_method]
optional, enumerated string
Possible values are
no_preference

No Preference

cash

Cash

check

Check

bank_transfer

Bank Transfer

Show all values[+]
subscription[contract_term_billing_cycle_on_renewal]
optional, integer, min=1, max=100
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
customer[vat_number]
optional, string, max chars=20
customer[vat_number_prefix]
optional, string, max chars=10
customer[registered_for_gst]
optional, boolean
contract_term[action_at_term_end]
optional, 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.
evergreen

Contract term completes and the subscription renews.

cancel

Contract term completes and subscription is canceled.

renew_once

Used when you want to renew the contract term just once. Does the following:-Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal.

  • The action_at_term_end for the new contract term is set to cancel.
Show all values[+]
contract_term[cancellation_cutoff_period]
optional, integer
subscription_items[item_price_id][0..n]
required, string, max chars=100
subscription_items[quantity][0..n]
optional, integer, min=1
subscription_items[quantity_in_decimal][0..n]
optional, string, max chars=33
subscription_items[unit_price][0..n]
optional, in cents, min=0
subscription_items[unit_price_in_decimal][0..n]
optional, string, max chars=39
subscription_items[billing_cycles][0..n]
optional, integer, min=0
subscription_items[trial_end][0..n]
optional, timestamp(UTC) in seconds
subscription_items[service_period_days][0..n]
optional, integer, min=1, max=730
subscription_items[charge_on_event][0..n]
optional, enumerated string
Possible values are
subscription_creation

the time of creation of the subscription.

subscription_trial_start

the time when the trial period of the subscription begins.

plan_activation

same as subscription activation, but also includes the case when the plan-item of the subscription is changed.

subscription_activation

the moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.

Show all values[+]
subscription_items[charge_once][0..n]
optional, boolean
subscription_items[charge_on_option][0..n]
optional, enumerated string
Possible values are
immediately

The item is charged immediately on being added to the subscription.

on_event

The item is charged at the occurrence of the event specified as charge_on_event .

Show all values[+]
subscription_items[start_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[end_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[ramp_tier_id][0..n]
optional, string, max chars=105
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[duration_type][0..n]
required, enumerated string, default=forever
Possible values are
one_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit .

Show all values[+]
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[operation_type][0..n]
required, enumerated string
Possible values are
add

The discount is attached to the subscription.

remove

The discount (given by discounts[id] ) is removed from the subscription. Subsequent invoices will no longer have the discount applied. Tip: If you want to replace a discount, remove it and add another in the same API call.

Show all values[+]
discounts[id][0..n]
optional, string, max chars=50
discounts[start_date][0..n]
optional, timestamp(UTC) in seconds
discounts[end_date][0..n]
optional, timestamp(UTC) in seconds
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
item_tiers[ramp_tier_id][0..n]
optional, string, max chars=105
coupons[id][0..n]
optional, string, max chars=100
coupons[start_date][0..n]
optional, timestamp(UTC) in seconds
coupons[end_date][0..n]
optional, timestamp(UTC) in seconds
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Changes the quote produced for updating the subscription items.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/6/edit_update_subscription_quote_for_items \
     -X POST  \
     -u {site_api_key}:\
     -d "subscription_items[item_price_id][0]"="basic-USD" \
     -d "subscription_items[unit_price][0]"=1520 \
     -d "subscription_items[quantity][0]"=2 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 1290,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 0,
        "credits_applied": 1750,
        "currency_code": "USD",
        "customer_id": "__test__KyVlFpS4cWEDZ1I",
        "date": 1517485111,
        "id": "6",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 3040,
                "customer_id": "__test__KyVlFpS4cWEDZ1I",
                "date_from": 1517485111,
                "date_to": 1519904310,
                "description": "basic USD - Prorated Charges",
                "discount_amount": 0,
                "entity_id": "basic-USD",
                "entity_type": "plan_item_price",
                "id": "__test__KyVlFpS4cWEpb1i",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "per_unit",
                "quantity": 2,
                "tax_amount": 0,
                "unit_amount": 1520
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "change_subscription",
        "price_type": "tax_exclusive",
        "resource_version": 1517485111000,
        "status": "open",
        "sub_total": 3040,
        "subscription_id": "__test__KyVlFpS4cWES31O",
        "taxes": [],
        "total": 3040,
        "updated_at": 1517485111,
        "valid_till": 1517596199,
        "version": 2
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/edit_update_subscription_quote_for_items

Method

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

mandatory_items_to_remove[[0..n]][0..n]
optional, list of string

Item ids of mandatorily attached addons that are to be removed from the subscription.

replace_items_list[]
optional, boolean, default=false

If true then the existing subscription_items list for the subscription is replaced by the one provided. If false then the provided subscription_items list gets added to the existing list.

billing_cycles[]
optional, integer, min=0

Billing cycles set for plan-item price is used by default.

terms_to_charge[]
optional, integer, min=1

The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge is inclusive of this new term. See description for the force_term_reset parameter to learn more about when a subscription term is reset.

reactivate_from[]
optional, timestamp(UTC) in seconds

If the subscription status is cancelled and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated. Note: It is recommended not to pass this parameter along with changed_scheduled_at. reactivate_from can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:

  • Backdating must be enabled for subscription reactivation operations.
  • The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
  • The date is on or after the last date/time any of the product catalog items of the subscription were changed.
  • The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April, changes_scheduled_at cannot be earlier than 14th February. .
billing_alignment_mode[]
optional, enumerated string

Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.

Possible values are
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

Show all values[+]
coupon_ids[[0..n]][0..n]
optional, list of string

The list of IDs of the coupons to be applied. Coupon codes are also supported.

Note

Not applicable when Chargebee CPQ is enabled. Use coupons[] array instead.

replace_coupon_list[]
optional, boolean, default=false

Should be true if the existing coupons should be replaced with the ones that are being passed.

change_option[]
optional, enumerated string

When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out.

Possible values are
immediately

The change is carried out immediately.

specific_date

The change is carried out as of the date specified under changes_scheduled_at .

Show all values[+]
changes_scheduled_at[]
optional, timestamp(UTC) in seconds

When change_option is set to specific_date , then set the date/time at which the subscription change is to happen or has happened. changes_scheduled_at can be set to a value in the past. This is called backdating the subscription change and is performed when the subscription change has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:

  • Backdating must be enabled for subscription change operations.

  • Only the following changes can be backdated:

  • Changes in the recurring items or their prices.

  • Addition of non-recurring items.

  • Subscription status is active, cancelled, or non_renewing.

  • The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.

  • The date is on or after current_term_start.

  • The date is on or after the last date/time any of the following changes were made:

  • Changes in the recurring items or their prices.

  • Addition of non-recurring items.

  • The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, changes_scheduled_at cannot be earlier than 14th February. .

force_term_reset[]
optional, boolean, default=false

Applicable for 'Active' & 'Non Renewing' states alone. Generally, subscription's term will be reset (i.e current term is ended and a new term starts immediately) when a new plan having different billing frequency is specified in the input. For all the other cases, the subscription's term will remain intact. Now for this later scenario, if you want to force a term reset you can specify this param as 'true'. Note: Specifying this value as 'false' has no impact on the default behaviour.

reactivate[]
optional, boolean

Applicable only for cancelled subscriptions. Once this is passed as true, cancelled subscription will become active; otherwise subscription changes will be made but the subscription state will remain cancelled. If not passed, subscription will be activated only if there is any change in subscription data.

net_term_days[]
optional, integer

The number of days within which the customer has to make payment for the invoice.

Note The parameter applies only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

subscription[start_date]
optional, timestamp(UTC) in seconds
subscription[trial_end]
optional, timestamp(UTC) in seconds
subscription[auto_collection]
optional, enumerated string
Possible values are
on

Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.

off

Automatic collection of charges will not be made for this subscription. Use this for offline payments.

Show all values[+]
subscription[offline_payment_method]
optional, enumerated string
Possible values are
no_preference

No Preference

cash

Cash

check

Check

bank_transfer

Bank Transfer

Show all values[+]
subscription[contract_term_billing_cycle_on_renewal]
optional, integer, min=1, max=100
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
customer[vat_number]
optional, string, max chars=20
customer[vat_number_prefix]
optional, string, max chars=10
customer[registered_for_gst]
optional, boolean
contract_term[action_at_term_end]
optional, 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.
evergreen

Contract term completes and the subscription renews.

cancel

Contract term completes and subscription is canceled.

renew_once

Used when you want to renew the contract term just once. Does the following:-Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal.

  • The action_at_term_end for the new contract term is set to cancel.
Show all values[+]
contract_term[cancellation_cutoff_period]
optional, integer
subscription_items[item_price_id][0..n]
required, string, max chars=100
subscription_items[quantity][0..n]
optional, integer, min=1
subscription_items[quantity_in_decimal][0..n]
optional, string, max chars=33
subscription_items[unit_price][0..n]
optional, in cents, min=0
subscription_items[unit_price_in_decimal][0..n]
optional, string, max chars=39
subscription_items[billing_cycles][0..n]
optional, integer, min=0
subscription_items[trial_end][0..n]
optional, timestamp(UTC) in seconds
subscription_items[service_period_days][0..n]
optional, integer, min=1, max=730
subscription_items[charge_on_event][0..n]
optional, enumerated string
Possible values are
subscription_creation

the time of creation of the subscription.

subscription_trial_start

the time when the trial period of the subscription begins.

plan_activation

same as subscription activation, but also includes the case when the plan-item of the subscription is changed.

subscription_activation

the moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.

Show all values[+]
subscription_items[charge_once][0..n]
optional, boolean
subscription_items[charge_on_option][0..n]
optional, enumerated string
Possible values are
immediately

The item is charged immediately on being added to the subscription.

on_event

The item is charged at the occurrence of the event specified as charge_on_event .

Show all values[+]
subscription_items[start_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[end_date][0..n]
optional, timestamp(UTC) in seconds
subscription_items[ramp_tier_id][0..n]
optional, string, max chars=105
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[duration_type][0..n]
required, enumerated string, default=forever
Possible values are
one_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit .

Show all values[+]
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[operation_type][0..n]
required, enumerated string
Possible values are
add

The discount is attached to the subscription.

remove

The discount (given by discounts[id] ) is removed from the subscription. Subsequent invoices will no longer have the discount applied. Tip: If you want to replace a discount, remove it and add another in the same API call.

Show all values[+]
discounts[id][0..n]
optional, string, max chars=50
discounts[start_date][0..n]
optional, timestamp(UTC) in seconds
discounts[end_date][0..n]
optional, timestamp(UTC) in seconds
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
item_tiers[ramp_tier_id][0..n]
optional, string, max chars=105
coupons[id][0..n]
optional, string, max chars=100
coupons[start_date][0..n]
optional, timestamp(UTC) in seconds
coupons[end_date][0..n]
optional, timestamp(UTC) in seconds
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Creates a quote using charge-items and one-time charges.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/create_for_charge_items_and_charges \
     -u {site_api_key}:\
     -d customer_id="__test__KyVlFpS4cWCm4J" \
     -d "item_prices[item_price_id][0]"="ssl-charge-USD" 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVlFpS4cWCm4J",
        "date": 1517485104,
        "id": "2",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 500,
                "customer_id": "__test__KyVlFpS4cWCm4J",
                "date_from": 1517485104,
                "date_to": 1517485104,
                "description": "SSL Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "ssl-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__KyVlFpS4cWCzmS",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 500
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517485104000,
        "status": "open",
        "sub_total": 500,
        "taxes": [],
        "total": 500,
        "total_payable": 500,
        "updated_at": 1517485104,
        "valid_till": 1517596199,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/create_for_charge_items_and_charges

Method

name[]
optional, string, max chars=100

The quote name will be used as the pdf name of the quote.

customer_id[]
required, string, max chars=50

Identifier of the customer for which the quote needs to be created.

po_number[]
optional, string, max chars=100

Purchase Order Number for this quote.

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

currency_code[]
required if Multicurrency is enabled, string, max chars=3

The currency code (ISO 4217 format) of the quote.

coupon[]
optional, string, max chars=100

The 'One Time' coupon to be applied.

coupon_ids[[0..n]][0..n]
optional, list of string

List of Coupons to be added.

billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
item_prices[item_price_id][0..n]
optional, string, max chars=100
item_prices[quantity][0..n]
optional, integer, min=1
item_prices[quantity_in_decimal][0..n]
optional, string, max chars=33
item_prices[unit_price][0..n]
optional, in cents, min=0
item_prices[unit_price_in_decimal][0..n]
optional, string, max chars=39
item_prices[service_period_days][0..n]
optional, integer, min=1, max=730
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
charges[amount][0..n]
optional, in cents, min=1
charges[amount_in_decimal][0..n]
optional, string, max chars=39
charges[description][0..n]
optional, string, max chars=250
charges[avalara_sale_type][0..n]
optional, enumerated string
Possible values are
wholesale

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

retail

Transaction is a sale to an end user

consumed

Transaction is for an item that is consumed directly

vendor_use

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

Show all values[+]
charges[avalara_transaction_type][0..n]
optional, integer
charges[avalara_service_type][0..n]
optional, integer
charges[service_period][0..n]
optional, integer
charges[discount_amount][0..n]
optional, in cents, min=0
charges[discount_percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[quantity][0..n]
optional, integer, min=1
discounts[amount][0..n]
optional, in cents, min=0
discounts[apply_on][0..n]
required, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[item_price_id][0..n]
optional, string, max chars=100
tax_providers_fields[provider_name][0..n]
optional, string, max chars=50
tax_providers_fields[field_id][0..n]
optional, string, max chars=50
tax_providers_fields[field_value][0..n]
optional, string, max chars=50
quote quote
always returned
Resource object representing quote
quoted_charge quoted_charge
optional
Resource object representing quoted_charge

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Changes the quote produced for adding one-time charges and charge items.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/5/edit_for_charge_items_and_charges \
     -X POST  \
     -u {site_api_key}:\
     -d "charges[amount][0]"=1520 \
     -d "charges[description][0]"="Service Charge" \
     -d "item_prices[item_price_id][0]"="ssl-charge-USD" 
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 1520,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 1520,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVlFpS4cWDzu12",
        "date": 1517485109,
        "id": "5",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 1520,
                "customer_id": "__test__KyVlFpS4cWDzu12",
                "date_from": 1517485109,
                "date_to": 1517485109,
                "description": "Service Charge",
                "discount_amount": 0,
                "entity_type": "adhoc",
                "id": "__test__KyVlFpS4cWE9a1G",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 1520
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517485109000,
        "status": "open",
        "sub_total": 1520,
        "taxes": [],
        "total": 1520,
        "total_payable": 1520,
        "updated_at": 1517485109,
        "valid_till": 1517596199,
        "version": 2
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/edit_for_charge_items_and_charges

Method

po_number[]
optional, string, max chars=100

Purchase Order Number for this quote.

notes[]
optional, string, max chars=2000

Notes specific to this quote that you want customers to see on the quote PDF.

expires_at[]
optional, timestamp(UTC) in seconds

Quotes will be valid till this date. After this quote will be marked as closed.

currency_code[]
required if Multicurrency is enabled, string, max chars=3

The currency code (ISO 4217 format) of the quote.

coupon[]
optional, string, max chars=100

The 'One Time' coupon to be applied.

coupon_ids[[0..n]][0..n]
optional, list of string

List of Coupons to be added.

billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
item_prices[item_price_id][0..n]
optional, string, max chars=100
item_prices[quantity][0..n]
optional, integer, min=1
item_prices[quantity_in_decimal][0..n]
optional, string, max chars=33
item_prices[unit_price][0..n]
optional, in cents, min=0
item_prices[unit_price_in_decimal][0..n]
optional, string, max chars=39
item_prices[service_period_days][0..n]
optional, integer, min=1, max=730
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
item_tiers[pricing_type][0..n]
optional, enumerated string
Possible values are
per_unit

Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).

flat_fee

Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the stairstep pricing model, pricing_type will be set to flat_fee by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.

package

Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).

Show all values[+]
item_tiers[package_size][0..n]
optional, integer, min=1
charges[amount][0..n]
optional, in cents, min=1
charges[amount_in_decimal][0..n]
optional, string, max chars=39
charges[description][0..n]
optional, string, max chars=250
charges[avalara_sale_type][0..n]
optional, enumerated string
Possible values are
wholesale

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

retail

Transaction is a sale to an end user

consumed

Transaction is for an item that is consumed directly

vendor_use

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

Show all values[+]
charges[avalara_transaction_type][0..n]
optional, integer
charges[avalara_service_type][0..n]
optional, integer
charges[service_period][0..n]
optional, integer
charges[discount_amount][0..n]
optional, in cents, min=0
charges[discount_percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[quantity][0..n]
optional, integer, min=1
discounts[amount][0..n]
optional, in cents, min=0
discounts[apply_on][0..n]
required, enumerated string
Possible values are
invoice_amount

The discount is applied to the invoice sub_total .

specific_item_price

The discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id .

Show all values[+]
discounts[item_price_id][0..n]
optional, string, max chars=100
tax_providers_fields[provider_name][0..n]
optional, string, max chars=50
tax_providers_fields[field_id][0..n]
optional, string, max chars=50
tax_providers_fields[field_value][0..n]
optional, string, max chars=50
quote quote
always returned
Resource object representing quote
quoted_charge quoted_charge
optional
Resource object representing quoted_charge

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

List all quotes.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=3 \
     --data-urlencode "status[in]"=["accepted"] \
     --data-urlencode "sort_by[asc]"=date
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "quote": {
                "amount_due": 4500,
                "amount_paid": 0,
                "billing_address": {
                    "first_name": "John",
                    "last_name": "Doe",
                    "object": "billing_address",
                    "validation_status": "not_validated"
                },
                "charge_on_acceptance": 4500,
                "credits_applied": 0,
                "currency_code": "USD",
                "customer_id": "__test__8aszcSOcl5c91O",
                "date": 1517494508,
                "id": "4",
                "line_item_discounts": [],
                "line_item_taxes": [],
                "line_items": [
                    {
                        "amount": 4000,
                        "customer_id": "__test__8aszcSOcl5c91O",
                        "date_from": 1517494508,
                        "date_to": 1517494508,
                        "description": "Encryption Charge USD Monthly",
                        "discount_amount": 0,
                        "entity_id": "encryption-charge-USD",
                        "entity_type": "charge_item_price",
                        "id": "__test__8aszcSOcl5hA1Z",
                        "is_taxed": false,
                        "item_level_discount_amount": 0,
                        "object": "line_item",
                        "pricing_model": "flat_fee",
                        "quantity": 1,
                        "tax_amount": 0,
                        "unit_amount": 4000
                    },
                    {..}
                ],
                "object": "quote",
                "operation_type": "onetime_invoice",
                "price_type": "tax_exclusive",
                "resource_version": 1517494508444,
                "status": "accepted",
                "sub_total": 4500,
                "taxes": [],
                "total": 4500,
                "total_payable": 4500,
                "updated_at": 1517494508,
                "valid_till": 1526134508,
                "version": 1
            }
        },
        {..}
    ]
}

URL Format GET

https://{site}.chargebee.com/api/v2/quotes

Method

limit[]
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset[]
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set 'offset' to the value of 'next_offset' obtained in the previous iteration of the API call.
include_deleted[]
optional, boolean, default=false

If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted ' attribute will be 'true '.

sort_by[<sort-order>]
optional, string filter
Sorts based on the specified attribute.
Supported attributes : date
Supported sort-orders : asc, desc

Example sort_by[asc] = "date"
This will sort the result based on the 'date' attribute in ascending(earliest first) order.
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
optional, string filter

The quote number. Acts as a identifier for quote and typically generated sequentially. Supported operators : is, is_not, starts_with, in, not_in

Example → id[is] = "123"

Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "123"
id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
customer_id[<operator>]
optional, string filter

The identifier of the customer this quote belongs to. Supported operators : is, is_not, starts_with, in, not_in

Example → customer_id[is_not] = "4gmiXbsjdm"

Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example customer_id[is] = "4gmiXbsjdm"
customer_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
customer_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
subscription_id[<operator>]
optional, string filter

To filter based on subscription_id. NOTE: Not to be used if consolidated invoicing feature is enabled. Supported operators : is, is_not, starts_with, is_present, in, not_in

Example → subscription_id[is_not] = "4gmiXbsjdm"

Possible values are :
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example subscription_id[is] = "4gmiXbsjdm"
subscription_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
subscription_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
subscription_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[<operator>]
optional, enumerated string filter

Current status of this quote. Possible values are : open, accepted, declined, invoiced, closed, pending_approval, approval_rejected, proposed, voided, expired
Supported operators : is, is_not, in, not_in

Example status[is] = "open"

status[is][operator]
optional, enumerated string filter
Possible values are : open, accepted, declined, invoiced, closed, pending_approval, approval_rejected, proposed, voided, expired
Supported operators :

Example
status[is_not][operator]
optional, enumerated string filter
Possible values are : open, accepted, declined, invoiced, closed, pending_approval, approval_rejected, proposed, voided, expired
Supported operators :

Example
status[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
date[<operator>]
optional, timestamp(UTC) in seconds filter

Creation date of the quote. Typically this is the date on which quote is generated. Supported operators : after, before, on, between

Example → date[on] = "1435054328"

Possible values are :
Supported operators : after, before, on, between

Example date[after] = "1435054328"
date[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
updated_at[<operator>]
optional, timestamp(UTC) in seconds filter

To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28. Supported operators : after, before, on, between

Example → updated_at[on] = "1243545465"

Possible values are :
Supported operators : after, before, on, between

Example updated_at[after] = "1243545465"
updated_at[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp
next_offset next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

This API retrieves all the quote line groups and lineitems for a quote.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/7/quote_line_groups \
     -G  \
     -u {site_api_key}:
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "quote_line_group": {
                "amount_due": 4500,
                "amount_paid": 0,
                "charge_event": "immediate",
                "credits_applied": 0,
                "id": "qlg___test__8aszcSOcl7oQ2N",
                "line_item_discounts": [],
                "line_item_taxes": [],
                "line_items": [
                    {
                        "amount": 4000,
                        "customer_id": "__test__8aszcSOcl7j12D",
                        "date_from": 1517494516,
                        "date_to": 1517494516,
                        "description": "Encryption Charge USD Monthly",
                        "discount_amount": 0,
                        "entity_id": "encryption-charge-USD",
                        "entity_type": "charge_item_price",
                        "id": "__test__8aszcSOcl7oR2O",
                        "is_taxed": false,
                        "item_level_discount_amount": 0,
                        "object": "line_item",
                        "pricing_model": "flat_fee",
                        "quantity": 1,
                        "tax_amount": 0,
                        "unit_amount": 4000
                    },
                    {..}
                ],
                "object": "quote_line_group",
                "sub_total": 4500,
                "taxes": [],
                "total": 4500,
                "version": 1
            }
        },
        {..}
    ]
}

URL Format GET

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/quote_line_groups

Method

limit[]
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset[]
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set 'offset' to the value of 'next_offset' obtained in the previous iteration of the API call.
quote_line_group quote_line_group
always returned
Resource object representing quote_line_group
next_offset next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

This API is to convert a quote to an invoice.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/1/convert \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "customer": {
        "allow_direct_debit": false,
        "auto_collection": "on",
        "card_status": "valid",
        "created_at": 1517494504,
        "deleted": false,
        "excess_payments": 0,
        "first_name": "John",
        "id": "__test__8aszcSOcl4hbQ",
        "last_name": "Doe",
        "net_term_days": 0,
        "object": "customer",
        "payment_method": {
            "gateway": "chargebee",
            "gateway_account_id": "gw___test__8at1FSOcl3IX1y",
            "object": "payment_method",
            "reference_id": "tok___test__8aszcSOcl4n5R",
            "status": "valid",
            "type": "card"
        },
        "pii_cleared": "active",
        "preferred_currency_code": "USD",
        "primary_payment_source_id": "pm___test__8aszcSOcl4nKS",
        "promotional_credits": 0,
        "refundable_credits": 0,
        "resource_version": 1517494504941,
        "taxability": "taxable",
        "unbilled_charges": 0,
        "updated_at": 1517494504
    },
    "invoice": {
        "adjustment_credit_notes": [],
        "amount_adjusted": 0,
        "amount_due": 0,
        "amount_paid": 4500,
        "amount_to_collect": 0,
        "applied_credits": [],
        "base_currency_code": "USD",
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl4hbQ",
        "date": 1517494506,
        "deleted": false,
        "due_date": 1517494506,
        "dunning_attempts": [],
        "exchange_rate": 1,
        "first_invoice": true,
        "has_advance_charges": false,
        "id": "__demo_inv__1",
        "is_gifted": false,
        "issued_credit_notes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl4hbQ",
                "date_from": 1517494506,
                "date_to": 1517494506,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "li___test__8aszcSOcl5Bvi",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "tax_exempt_reason": "tax_not_configured",
                "unit_amount": 4000
            },
            {..}
        ],
        "linked_orders": [],
        "linked_payments": [
            {
                "applied_amount": 4500,
                "applied_at": 1517494506,
                "txn_amount": 4500,
                "txn_date": 1517494506,
                "txn_id": "txn___test__8aszcSOcl5Fuk",
                "txn_status": "success"
            },
            {..}
        ],
        "net_term_days": 0,
        "new_sales_amount": 4500,
        "object": "invoice",
        "paid_at": 1517494506,
        "price_type": "tax_exclusive",
        "recurring": false,
        "resource_version": 1517494506800,
        "round_off_amount": 0,
        "status": "paid",
        "sub_total": 4500,
        "tax": 0,
        "term_finalized": true,
        "total": 4500,
        "updated_at": 1517494506,
        "write_off_amount": 0
    },
    "quote": {
        "amount_due": 4500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 4500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl4hbQ",
        "date": 1517494506,
        "id": "1",
        "invoice_id": "__demo_inv__1",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl4hbQ",
                "date_from": 1517494505,
                "date_to": 1517494505,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__8aszcSOcl55eb",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 4000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517494506843,
        "status": "invoiced",
        "sub_total": 4500,
        "taxes": [],
        "total": 4500,
        "total_payable": 4500,
        "updated_at": 1517494506,
        "valid_till": 1526134505,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/convert

Method

invoice_date[]
optional, timestamp(UTC) in seconds

The document date displayed on the invoice PDF. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. When not provided, the value is the same as current date. Moreover, if the invoice is created as pending , and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes and line_item_taxes are computed based on the tax configuration as of invoice_date. When passing this parameter, the following prerequisites must be met:

  • invoice_date must be in the past.
  • invoice_date is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
  • The date is not earlier than quoted_subscription.start_date or quoted_subscription.changes_scheduled_at (whichever is applicable).
  • invoice_immediately must be true. .
invoice_immediately[]
optional, boolean

If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings .

Note: invoice_immediately only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.

.

create_pending_invoices[]
optional, boolean

This attribute is set to true automatically for the subscription when it has one or more metered items. However, when there are no metered items, you can pass this parameter as true to force all invoices (except the first) to be created as pending. This is useful in the following scenarios:

  • When you manage metered billing at your end by calculating usage-based charges yourself and add them to the subscription as one-time charges.
  • When your workflow involves inspecting all charges before you close invoices.

Note:

  • You must enable Metered Billing for this parameter to be acceptable.
  • To create the first invoice also as pending, pass first_invoice_pending as true.

.

first_invoice_pending[]
optional, boolean, default=false

Non-metered items are billed at the beginning of a billing cycle while metered items are billed at the end. Consequently, the first invoice of the subscription contains only the non-metered items.

By passing this parameter as true, you create the first invoice as pending allowing you to add the previous term's metered charges to it before closing. This is useful when the subscription is moved to Chargebee from a different billing system. As applicable to all pending invoices, this invoice is also closed automatically or via an API call.

Note:

This parameter is passed only when there are metered items in the subscription or when create_pending_invoices is true.

.

subscription[id]
optional, string, max chars=50
subscription[auto_collection]
optional, enumerated string
Possible values are
on

Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.

off

Automatic collection of charges will not be made for this subscription. Use this for offline payments.

Show all values[+]
subscription[po_number]
optional, string, max chars=100
subscription[auto_close_invoices]
optional, boolean
quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_charge quoted_charge
optional
Resource object representing quoted_charge
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp
customer customer
always returned
Resource object representing customer
subscription subscription
optional
Resource object representing subscription
invoice invoice
optional
Resource object representing invoice
credit_note credit_note
optional
Resource object representing credit_note
unbilled_charges unbilled_charges
optional
Resource object representing unbilled_charges

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Updates the status of the quote.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/9/update_status \
     -u {site_api_key}:\
     -d status="ACCEPTED"
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 4500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 4500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl82K2h",
        "date": 1517494517,
        "id": "9",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl82K2h",
                "date_from": 1517494517,
                "date_to": 1517494517,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__8aszcSOcl88r2s",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 4000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517494518019,
        "status": "accepted",
        "sub_total": 4500,
        "taxes": [],
        "total": 4500,
        "total_payable": 4500,
        "updated_at": 1517494518,
        "valid_till": 1526134517,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/update_status

Method

status[]
required, enumerated string

The status to which the quote should be updated.

Possible values are
accepted

The customer has accepted the quote.

declined

The customer declined/rejected the quote.

proposed

The quote has been shared with the customer via email or e-signature and is awaiting their response.

Note

Applicable only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

voided

The quote has been invalidated and can no longer be acted upon.

Note

Applicable only when Chargebee CPQ is enabled. To request access, contact Chargebee Support.

Show all values[+]
comment[]
optional, string, max chars=300

An internal comment to be added for this operation, to the quote. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Quote PDF .

quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_charge quoted_charge
optional
Resource object representing quoted_charge
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Can be used to extend the expiry date of a quote.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/3/extend_expiry_date \
     -u {site_api_key}:\
     -d valid_till=1534774507
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 4500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 4500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl5Th17",
        "date": 1517494507,
        "id": "3",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl5Th17",
                "date_from": 1517494507,
                "date_to": 1517494507,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__8aszcSOcl5ZS1I",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 4000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517494507969,
        "status": "open",
        "sub_total": 4500,
        "taxes": [],
        "total": 4500,
        "total_payable": 4500,
        "updated_at": 1517494507,
        "valid_till": 1534774507,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/extend_expiry_date

Method

valid_till[]
required, timestamp(UTC) in seconds

Quote will be valid till this date. After this date quote will be marked as closed.

quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_charge quoted_charge
optional
Resource object representing quoted_charge
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Delete a quote using this API.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/2/delete \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "quote": {
        "amount_due": 4500,
        "amount_paid": 0,
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "object": "billing_address",
            "validation_status": "not_validated"
        },
        "charge_on_acceptance": 4500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__8aszcSOcl5L2q",
        "date": 1517494507,
        "id": "2",
        "line_item_discounts": [],
        "line_item_taxes": [],
        "line_items": [
            {
                "amount": 4000,
                "customer_id": "__test__8aszcSOcl5L2q",
                "date_from": 1517494507,
                "date_to": 1517494507,
                "description": "Encryption Charge USD Monthly",
                "discount_amount": 0,
                "entity_id": "encryption-charge-USD",
                "entity_type": "charge_item_price",
                "id": "__test__8aszcSOcl5QU11",
                "is_taxed": false,
                "item_level_discount_amount": 0,
                "object": "line_item",
                "pricing_model": "flat_fee",
                "quantity": 1,
                "tax_amount": 0,
                "unit_amount": 4000
            },
            {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517494507372,
        "status": "open",
        "sub_total": 4500,
        "taxes": [],
        "total": 4500,
        "total_payable": 4500,
        "updated_at": 1517494507,
        "valid_till": 1526134507,
        "version": 1
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/delete

Method

comment[]
optional, string, max chars=300

Reason for deleting this transaction. This comment will be added to the associated entity.

quote quote
always returned
Resource object representing quote
quoted_subscription quoted_subscription
optional
Resource object representing quoted_subscription
quoted_charge quoted_charge
optional
Resource object representing quoted_charge
quoted_ramp quoted_ramp
optional
Resource object representing quoted_ramp

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x
Try in API Explorer

Retrieves the quote as a PDF. The returned URL is secure, allows download and expires in 60 minutes.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/quotes/6/pdf \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy
200:
OK
STATUS

Sample Response [ JSON ]

Show more...
{
    "download": {
        "download_url": "https://cb-local-downloads.s3.amazonaws.com/yourapp/quote/__test__8aszcSOcl6k02B.pdf?response-content-disposition=attachment%3Bfilename%3Dyourapp%2Fquote%2F__test__8aszcSOcl6k02B.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210210T141516Z&X-Amz-SignedHeaders=host&X-Amz-Expires=599&X-Amz-Credential=AKIAJI4SN7ONHAOGLOGA%2F20210210%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=d7b1382e1dbe9de4cd1f900abb7df9596ebb54d936083da898ca3931ba91de5e",
        "object": "download",
        "valid_till": 1612967116
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/quotes/{quote-id}/pdf

Method

consolidated_view[]
optional, boolean, default=false

When true, the quote PDF has summary of all charges on the quote. When false, the quote PDF has a detailed view of charges grouped by charge event. This parameter does not affect one-time quotes.

disposition_type[]
optional, enumerated string, default=attachment

Determines the pdf should be rendered as inline or attachment in the browser.

Possible values are
attachment

PDF is rendered as attachment in the browser

inline

PDF is rendered as inline in the browser

Show all values[+]
download download
always returned
Resource object representing download

Sample admin console URL

https://{site}.chargebee.com/admin-console/quotes/123x