ChargebeeAPI

Create invoice for items and one-time charges

Idempotency Supported
Try in API Explorer

Creates an invoice for charge-items and one-time charges. The item prices must belong to items of type charge.

One-time charges are represented in an invoice as line_items with entity_type adhoc.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/invoices/create_for_charge_items_and_charges

Input Parameters

customer_id
optional, string, max chars=50

Unique ID of the customer this invoice should be created for. Either this or subscription_id must be provided.

Note

The invoice is linked to the same business entity as this customer.

subscription_id
optional, string, max chars=50

Unique ID of the subscription this invoice should be created for. Either this or customer_id must be provided.

Note

The invoice is linked to the same business entity as this subscription.

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

The currency code (ISO 4217 format) of the invoice amount.

invoice_note
optional, string, max chars=2000

A note for this particular invoice. This, and all other notes for the invoice are displayed on the PDF invoice sent to the customer.

remove_general_note
optional, boolean, default=false

Set as true to remove the general note from this invoice.

po_number
optional, string, max chars=100

Purchase Order Number for this invoice.

coupon_ids
optional, string, max chars=100

List of Coupons to be added.

authorization_transaction_id
optional, string, max chars=40

Authorization transaction to be captured.

payment_source_id
optional, string, max chars=40

Payment source to be used for this payment.

auto_collection
optional, enumerated string

If specified, the customer level auto collection will be overridden.

Possible Enum Values
on

Whenever an invoice is created, an automatic attempt will be made to charge.

off

Whenever an invoice is created as payment due.

invoice_date
optional, timestamp(UTC) in seconds

The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. taxes and line_item_taxes are computed based on the tax configuration as of this date. The date should not be 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.

token_id
optional, string, max chars=40

Token generated by Chargebee JS representing payment method details.

replace_primary_payment_source
optional, boolean, default=false

Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.

retain_payment_source
optional, boolean, default=true

Indicates whether the payment source should be retained for the customer.

payment_initiator
optional, enumerated string

The type of initiator to be used for the payment request triggered by this operation.

Possible Enum Values
customer

Pass this value to indicate that the request is initiated by the customer

merchant

Pass this value to indicate that the request is initiated by the merchant

shipping_address[0..n]
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
statement_descriptor[0..n]
Parameters for statement_descriptor
pass parameters as statement_descriptor[<param name>]
card[0..n]
Parameters for card
pass parameters as card[<param name>]
bank_account[0..n]
Parameters for bank_account
pass parameters as bank_account[<param name>]
payment_method[0..n]
Parameters for payment_method
pass parameters as payment_method[<param name>]
payment_intent[0..n]
Parameters for payment_intent
pass parameters as payment_intent[<param name>]
item_prices[0..n]
Parameters for item_prices. Multiple item_prices can be passed by specifying unique indices.
pass parameters as item_prices[<param name>][<idx:0..n>]
item_tiers[0..n]
Parameters for item_tiers. Multiple item_tiers can be passed by specifying unique indices.
pass parameters as item_tiers[<param name>][<idx:0..n>]
charges[0..n]
Parameters for charges. Multiple charges can be passed by specifying unique indices.
pass parameters as charges[<param name>][<idx:0..n>]
notes_to_remove[0..n]
Parameters for notes_to_remove. Multiple notes_to_remove can be passed by specifying unique indices.
pass parameters as notes_to_remove[<param name>][<idx:0..n>]
tax_providers_fields[0..n]
Parameters for tax_providers_fields. Multiple tax_providers_fields can be passed by specifying unique indices.
pass parameters as tax_providers_fields[<param name>][<idx:0..n>]
discounts[0..n]
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]

Returns

invoiceInvoice object
Resource object representing invoice