Creates an advance invoice or an advance invoicing schedule. When an advance invoice is generated, and auto_collection is on for the subscription, the payment_source associated with the subscription is charged. Any changes scheduled for the subscription are taken into account automatically while generating an advance invoice. Advance invoices are not generated for a subscription when it is in the paused status. Advance invoices are generated only for non-metered items in a subscription.
- This operation is supported only on select plans. To know more, take a look at our plans and pricing page.
- This operation is not supported for
non_renewingandcancelledsubscriptions. - This operation is not supported if an advance invoice is already present. You could void/delete that invoice and try creating another advance invoice.
- For subscription with
ramps, this API will return error for the following scenarios- If the subscription has more than 12 ramps for the terms being invoiced.
- If
schedule_typeisspecific_datesorfixed_intervals - If subscription contains ramps scheduled for middle of the subscription term.
- This API will return an error when multi-frequency billing is enabled.
Sample Request
URL Format
Input Parameters
- For
schedule_type = immediate: the number of future billing cycles to be invoiced in advance. The invoicing is done for theremaining_billing_cyclesof the subscription if that is less thanterms_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. .
Whether the charge should be invoiced immediately or added to unbilled_charges.
Applicable only when schedule_type
is immediate
.
The type of advance invoice or advance invoicing schedule.
Charge immediately for the number of billing cycles specified by terms_to_charge
.
Charge on specific dates. For each date, specify the number of billing cycles to charge for. Up to 5 dates can be configured.
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 .
Returns
Resource object representing subscription
Resource object representing customer
Resource object representing card
Resource object representing invoice
Resource object representing advance_invoice_schedule