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.
{
"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
}
billing_address
country
as XI
(which is United Kingdom - Northern Ireland).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. curl https://{site}.chargebee.com/api/v2/quotes/8 \ -u {site_api_key}:
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
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
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
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. status
is cancelled
and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.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:
changes_scheduled_at
cannot be earlier than 14th February.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:
status
is active
, cancelled
, or non_renewing
. current_term_start
.changes_scheduled_at
cannot be earlier than 14th February.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
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. status
is cancelled
and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.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:
changes_scheduled_at
cannot be earlier than 14th February.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:
status
is active
, cancelled
, or non_renewing
. current_term_start
.changes_scheduled_at
cannot be earlier than 14th February.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"
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"
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
curl https://{site}.chargebee.com/api/v2/quotes/7/quote_line_groups \ -G \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/quotes/1/convert \ -X POST \ -u {site_api_key}:
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.quoted_subscription.start_date
or quoted_subscription.changes_scheduled_at
(whichever is applicable).invoice_immediately
must be true
.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.
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:
Note:
pending
, pass first_invoice_pending
as true
.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
.
curl https://{site}.chargebee.com/api/v2/quotes/9/update_status \ -u {site_api_key}:\ -d status="ACCEPTED"
curl https://{site}.chargebee.com/api/v2/quotes/3/extend_expiry_date \ -u {site_api_key}:\ -d valid_till=1534774507
curl https://{site}.chargebee.com/api/v2/quotes/2/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/quotes/6/pdf \ -X POST \ -u {site_api_key}: