Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.
Chargebeechargebee API

Regenerate Invoice Estimate

Regenerates the invoice for the current term of the subscription. The subscription must have status as active or non_renewing. This operation is not allowed when any of the following conditions hold true for the subscription:

  • An invoice exists for the current term and its status is not voided.
  • There are unbilled charges for the current term.
  • The subscription has an advance invoice.

Response

Returns an estimate object with one of the following components depending on the value of invoice_immediately.

  • If the value is true: an invoice_estimate object that corresponds to the regenerated invoice.
  • If the value is false: a list of unbilled_charge_estimate objects corresponding to all the unbilled charges created for the current term of the subscription.

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/subscriptions/{subscription-id}/regenerate_invoice_estimate

Input Parameters

date_from
optional, timestamp(UTC) in seconds

The start date of the period being invoiced. The default value is current_term_start .

date_to
optional, timestamp(UTC) in seconds

The end date of the period being invoiced. The default value is current_term_end .

prorate
optional, boolean

Whether the charges should be prorated according to the term specified by date_from and date_to. Should not be passed without date_from and date_to .

invoice_immediately
optional, boolean

Only applicable when Consolidated Invoicing is enabled for the customer. Set to false to leave the current term charge for the subscription as unbilled. Once you have done this for all suitable subscriptions of the customer, call Create an invoice for unbilled charges to invoice them.

Returns

Estimate object
Resource object representing estimate