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.
Prerequisites & Constraints
- At least one
line_itemsentry is required to import an invoice. taxesmust not be provided whenstatusispending.
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
Sample Result[JSON]
URL Format
Input Parameters
Identifier of the customer resource to which this invoice belongs.
customer_idis required whenline_itemsis provided.
customer_idis required whensubscription_idis not provided.- If
subscription_idis provided, for regular subscriptionscustomer_idmust match the subscription's customer.
The ID of the subscription resource to which this invoice belongs.
subscription_idis required when the invoice is a recurring invoice andline_items[subscription_id]is not provided.
subscription_idis required whencustomer_idis not provided.
The reason for exempting the invoice from tax. (Applicable only for exempted invoices.).
tax_override_reasonmust not be provided whenstatusispending.
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.
billing_address.countryis required to providevat_number_prefix.
round_offis not supported when your site's base currency is a zero-decimal currency.
Current status of this invoice.
- Metered Billing must be enabled for your site to import an invoice with
statusset topending.
- Invoice status 'posted' is not supported for non-recurring invoices unless payment terms for one-time invoices is enabled. Contact Support to enable this feature.
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.
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.
Amount written off against this invoice. If this value is not present then the due amount of the invoice will be written off.
statuscannot bepayment_due,posted, ornot_paidwhen the total payment amount pluswrite_off_amountequalstotal.
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.
write_off_dateis required whenis_written_offistrue.
write_off_datemust be in the past.write_off_datemust be afterdate.
The number of days from invoice.date until payment for the invoice is due.
net_term_daysis required whenstatusisposted.
net_term_daysmust be greater than 0.- Payment Terms must be enabled for your site to provide
due_dateandnet_term_days.
Boolean indicating any advance charge is present in this invoice.
- Can be set to
trueonly for a recurring invoice.