ChargebeeAPI

Convert a quote

Idempotency Supported
Try in API Explorer

This API is to convert a quote to an invoice.

Sample Request

URL Format

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

Input Parameters

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[0..n]
Parameters for subscription
pass parameters as subscription[<param name>]

Returns

quoteQuote object
Resource object representing quote
quoted_subscriptionQuoted subscription object
Resource object representing quoted_subscription
quoted_chargeQuoted charge object
Resource object representing quoted_charge
quoted_rampQuoted ramp object
Resource object representing quoted_ramp
customerCustomer object
Resource object representing customer
subscriptionSubscription object
Resource object representing subscription
invoiceInvoice object
Resource object representing invoice
credit_noteCredit note object
Resource object representing credit_note
Resource object representing unbilled_charge