Imports an invoice into Chargebee Billing.
Use this API to import invoices from your other billing or accounting system into Chargebee Billing. You can import both current-term and historical invoices.
Caution: Importing current-term invoices To ensure accurate proration for any changes to the subscription in the current term, import only one current-term invoice. Chargebee considers only the first imported invoice for the current term when calculating proration. If you have multiple invoices for the current term in the source system, consolidate them into a single invoice before importing it into Chargebee.
Impacts
RevenueStory
- You must run the MRR History Builder to update Revenue Story metrics after importing invoices. Contact Support to do this.
Accounting Integrations
- Chargebee Billing accounting integrations sync imported invoices, unless you disable them from syncing.
Implementation Notes
- If discounts are present on the invoice, then the following parameters must be passed:
discounts[entity_type][]discounts[amount][]discounts[line_item_id][i]ifdiscounts[entity_type][i]isitem_level_couponordocument_level_coupon.
- If taxes are present on the invoice, then the following parameters must be passed:
taxes[name][]taxes[rate][]line_items[tax*_name][]line_items[tax*_amount][]
Sample Request
URL Format
Input Parameters
The invoice ID (also known as the invoice number).
Constraints
- Must be unique so that it does not conflict with any existing
invoice.id.
The currency code (ISO 4217 format) for the invoice.
Identifier of the customer resource to which this invoice belongs.
Required if
subscription_idis not provided.
Constraints
- If
subscription_idis provided:- For regular subscriptions:
customer_idmust match the subscription's customer. - For gift subscriptions:
customer_idmust match the gifter's customer.
- For regular subscriptions:
The ID of the subscription resource to which this invoice belongs.
Required if
customer_idis not provided. OR- The invoice is a recurring invoice and
line_items.subscription_id[]are not provided.
The price type of the invoice.
All amounts in the document are exclusive of tax.
All amounts in the document are inclusive of tax.
The reason for exempting the invoice from tax. (Applicable only for exempted invoices.).
The customer is exempted from tax.
The customer is from a non-taxable region or the billing address and shipping address are unavailable.
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.
Invoice total amount.
Constraints
- Must be equal to (sum of
line_items[amount][]) - (sum ofdiscounts[amount][]) + (sum oftaxes[amount][]) +round_off_amount. - Cannot be
0if hiding zero-value line items is enabled.
Current status of this invoice.
Indicates a paid invoice.
Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period.
Prerequisites
- For a non-recurring invoice the value of
statuscan bepostedonly if payment terms for one-time invoices is enabled. Contact Support to enable this feature.
Indicates the payment is not yet collected and is being retried as per retry settings.
Indicates the payment is not made and all attempts to collect is failed.
Indicates a voided invoice.
The invoice is yet to be closed (sent for payment collection). An invoice is generated with this status when it has line items that belong to items that are metered or when the subscription.create_pending_invoicesattribute is set to true.
The invoice is yet to be closed (sent for payment collection). All invoices are generated with this status when Metered Billing is enabled for the site.
Prerequisites
- The value of
statuscan bependingonly if Metered Billing is enabled for the site.
Timestamp indicating the date & time this invoice got voided.
Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Invoices > Void invoice. Must be passed if set as mandatory in the app. The codes are case-sensitive.
If is_written_off is true then the invoice is written off.
Amount written off against this invoice. If this value is not present then the due amount of the invoice will be written off.
The date on which the write_off invoice has occurred. This is a mandatory field if is_written_off is true. The same date reflects on the created credit note.
The due date of the invoice.
Prerequisites
- For a non-recurring invoice,
due_datecan be provided only if payment terms for one-time invoices is enabled. Contact Support to enable this feature.
Required if
statusisposted.
Constraints
- Must be a date in the future if
statusisposted. - Must be a date in the past if
statusispayment_due.
Invoice net term days.
Prerequisites
- For a non-recurring invoice,
net_term_dayscan be provided only if payment terms for one-time invoices is enabled. Contact Support to enable this feature.
Required if
statusisposted.
Boolean indicating any advance charge is present in this invoice.
Contraints
- Can be set to
trueonly for a recurring invoice.
If the invoice falls within the subscription current term will be used for proration.
Returns
Resource object representing invoice
Resource object representing credit_note