Unbilled charge represents the charges that are held by passing invoice_later in various operations such as update subscription, add charge, create subscription, etc. Learn more.
If any invoice is to be created for a subscription all the unbilled charges associated with the subscription will be included in that invoice.
If any invoice is to be created for a customer, all the unbilled charges associated with its subscriptions will be included in that invoice.
Any automatic invoice creation like renewal, activation, etc., will include the unbilled charges.
Subscriptions are invoiced at the start of every term based on the recurring items and charged immediately against the customer's credit card if 'auto_collection' is turned 'on', otherwise the resulting invoice will be created as 'Payment Due'.
If consolidated invoicing is enabled, the charges during the subscription renewals/activations will be held and consolidated at the last renewal/activation that takes place on that particular day.
{
"unbilled_charges": [
{
"amount": 500,
"currency_code": "USD",
"customer_id": "__test__5SK2lmRmS627Arv5X",
"date_from": 1517483456,
"date_to": 1517483456,
"deleted": false,
"description": "SSL Charge USD Monthly",
"discount_amount": 0,
"entity_id": "ssl-charge-USD",
"entity_type": "charge_item_price",
"id": "li___test__5SK2lmRmS627B3A5f",
"is_voided": false,
"object": "unbilled_charge",
"pricing_model": "flat_fee",
"quantity": 1,
"subscription_id": "__test__5SK2lmRmS627AvF5Z",
"unit_amount": 500
}
]
}
unit_amount_in_decimal
x quantity_in_decimal
. Returned when multi-decimal pricing is enabled. curl https://{site}.chargebee.com/api/v2/unbilled_charges \ -u {site_api_key}:\ -d subscription_id="__test__5SK2lmRmS627AvF5Z" \ -d "item_prices[item_price_id][0]"="ssl-charge-USD"
curl https://{site}.chargebee.com/api/v2/unbilled_charges \ -u {site_api_key}:\ -d subscription_id="__test__5SK2lmRmS627BA25k" \ -d currency_code="usd" \ -d "charges[amount][0]"=100 \ -d "charges[description][0]"="Implementation charge"
item_price
. This is only applicable when the pricing_model
of the item_price
is flat_fee
or per_unit
. The value depends on the type of currency. pricing_model
is tiered
or volume
. The total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency. ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is tiered
, volume
or stairstep
and multi-decimal pricing is enabled. pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled. pricing_type
will be set to flat_fee
by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.packageIndicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).Use this API to bill the unbilled charges. Available Credits and Excess Payments will automatically be applied while creating the invoice.
If the Auto Collection is turned on for the particular customer, the invoice will be created in payment_due state and the payment collection will be scheduled immediately.
During invoice creation, the PO number for the line items will be filled from the subscription’s current PO number, if available.
If no recurring item is present in the created invoice, the invoice will be marked as recurring=false.
If consolidated invoicing is enabled and the parameter ‘customer_id’ is passed, multiple invoices can be created based on the following factors.
curl https://{site}.chargebee.com/api/v2/unbilled_charges/invoice_unbilled_charges \ -u {site_api_key}:\ -d subscription_id="__test__8aszcSOcqxg162"
curl https://{site}.chargebee.com/api/v2/unbilled_charges/invoice_unbilled_charges \ -u {site_api_key}:\ -d subscription_id="__test__8aszcSOcqxg162"
curl https://{site}.chargebee.com/api/v2/unbilled_charges/li___test__8aszcSOcqxX05r/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/unbilled_charges/li___test__8aszcSOcqxX05r/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/unbilled_charges \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode "customer_id[is]"="__test__8aszcSOcqy1i6F"
curl https://{site}.chargebee.com/api/v2/unbilled_charges \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode "customer_id[is]"="__test__8aszcSOcqy1i6F"
This is similar to the "Create an invoice for unbilled charges" API but no invoice will be created, only an estimate for this operation is created.
In the estimate response,
Note:
curl https://{site}.chargebee.com/api/v2/unbilled_charges/invoice_now_estimate \ -u {site_api_key}:\ -d customer_id="__test__8aszcSOcqyER6Q"
curl https://{site}.chargebee.com/api/v2/unbilled_charges/invoice_now_estimate \ -u {site_api_key}:\ -d customer_id="__test__8aszcSOcqyER6Q"