ChargebeeAPI

Create invoice for a one-time charge

Idempotency Supported

Generate invoices for a one-time charge using this API.

Sample Request

URL Format

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

Input Parameters

customer_id
optional, string, max chars=50

Identifier of the customer for which this invoice needs to be created. Should be specified if 'subscription_id' is not specified.

subscription_id
optional, string, max chars=50

Identifier of the subscription for which this invoice needs to be created. Should be specified if 'customer_id' is not specified.(not applicable for consolidated invoice).

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

The currency code (ISO 4217 format) of the invoice amount. Applicable only while creating an invoice for a customer (by specifying customer_id ).

amount
optional, in cents, min=1

The amount to be charged. The unit depends on the type of currency .

amount_in_decimal
optional, string, max chars=39

The decimal representation of the amount for the one-time charge. Provide the value in major units of the currency. Can be provided only when multi-decimal pricing is enabled.

description
required, string, max chars=250

Description for this charge.

date_from
optional, timestamp(UTC) in seconds

The time when the service period for the charge starts.

date_to
optional, timestamp(UTC) in seconds

The time when the service period for the charge ends.

coupon_ids
optional, string

List of Coupons to be added.

avalara_sale_type
optional, enumerated string

Indicates the type of sale carried out. This is applicable only if you use Chargebee's AvaTax for Communications integration.

Possible Enum Values
wholesale

Transaction is a sale to another company that will resell your product or service to another consumer

retail

Transaction is a sale to an end user

consumed

Transaction is for an item that is consumed directly

vendor_use

Transaction is for an item that is subject to vendor use tax

avalara_transaction_type
optional, integer

Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use Chargebee's AvaTax for Communications integration.

avalara_service_type
optional, integer

Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use Chargebee's AvaTax for Communications integration.

po_number
optional, string, max chars=100

Purchase Order Number for this invoice.

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.

payment_source_id
optional, string, max chars=40

Payment source to be used for this payment.

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

tax_providers_fields
optional, string

Parameters for tax_providers_fields

Returns

invoiceInvoice object

Resource object representing invoice