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

Advance invoice estimate

This API is used to generate an invoice estimate for preview. Estimate details include the number of billing cycles to be invoiced in advance, the number of billing cycles in one interval, advance invoicing schedules, and so on.

Sample Request

Sample Result[JSON]

URL Format

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

Input Parameters

terms_to_charge
optional, integer, default=1, min=1
  • For schedule_type = immediate: the number of future billing cycles to be invoiced in advance. The invoicing is done for the remaining_billing_cycles of the subscription if that is less than terms_to_charge.
  • For schedule_type = fixed_intervals: The number of future billing cycles in one interval. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles of the subscription. .
invoice_immediately
optional, boolean

Whether the charge should be invoiced immediately or added to unbilled_charges. Applicable only when schedule_type is immediate .

schedule_type
optional, enumerated string

The type of advance invoice or advance invoicing schedule.

Enum Values
immediate

Charge immediately for the number of billing cycles specified by terms_to_charge .

specific_dates

Charge on specific dates. For each date, specify the number of billing cycles to charge for. Up to 5 dates can be configured.

fixed_intervals

Charge at fixed intervals of time. Specify the number of billing cycles that constitute an interval and the number of days before each interval that the invoice should be generated. Also specify when the schedule should end .

fixed_interval_schedule
Parameters for fixed_interval_schedule
pass parameters as fixed_interval_schedule[<param name>]
specific_dates_schedule[0..n]
Parameters for specific_dates_schedule. Multiple specific_dates_schedule can be passed by specifying unique indices.
pass parameters as specific_dates_schedule[<param name>][<idx:0..n>]

Returns

Estimate object
Resource object representing estimate