ChargebeeAPI
Using AI coding agents like Claude Code or Cursor? Try the official Chargebee Agent Skills to speed up your development.Try now

Add one-time charge to a pending invoice

Idempotency Supported
Try in API Explorer

Adds a one-time charge to a pending invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined item price. It appears in the invoice as a line_item of entity_type adhoc.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/add_charge

Input Parameters

amount
required, in cents, min=1

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

description
required, string, max chars=250

Detailed description about this lineitem.

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.

avalara_tax_code
optional, string, max chars=50

This represents the Avalara tax code to which the one-time charge is mapped. Applicable only if you use Chargebee's AvaTax for Sales integration .

hsn_code
optional, string, max chars=50

The HSN code to which the one-time charge is mapped for calculating the customer's tax in India. Applicable when both the conditions are true:

taxjar_product_code
optional, string, max chars=50

This represents the TaxJar product code to which the one-time charge is mapped. Applicable only if you use Chargebee's TaxJar integration .

comment
optional, string, max chars=300

An internal comment to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Invoice PDF .

subscription_id
optional, string, max chars=50

Identifier of the subscription for which this charge needs to be created. Applicable for consolidated invoice.

line_item
Parameters for line_item
pass parameters as line_item[<param name>]

Returns

invoiceInvoice object
Resource object representing invoice