Menu
Advance Invoice Estimate
Advance invoice estimate
/subscriptions/{subscription-id}/advance_invoice_estimateUse it in a workflow
- Add a step and choose the Chargebee connector.
- Pick the Advance Invoice Estimate action (under Chargebee API).
- Fill in the fields below, then reference the result from later steps as
{{advanceInvoiceEstimate.response.data}}.
Request
Path parameters
subscription-idstringrequiredHeaders
chargebee-request-origin-devicestringThe device from which the customer has made the request
chargebee-request-origin-userstring (email)The email address of your customer/user. Use this when the email address has only ASCII characters.
chargebee-request-origin-user-encodedstring (email)The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.
chargebee-request-origin-ipstringThe IP address of the customer where the request originated
chargebee-event-actionsstringskip all actions to be done on the events
One ofall-disabled
chargebee-event-emailstringskip only emails
One ofall-disabled
chargebee-event-webhookstringskip only webhooks
One ofall-disabled
chargebee-business-entity-idstringIf the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.
Request body
Enter the body as JSON in the step's Body field.
terms_to_chargeinteger (int32)<ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">For <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">schedule_type = immediate</code>: the number of future billing cycles to be invoiced in advance. The invoicing is done for the <a href="/docs/api/subscriptions/subscription-object#remaining_billing_cycles"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">remaining_billing_cycles</code></a> of the subscription if that is less than <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">terms_to_charge</code>.</li> <li class="text-base leading-relaxed">For <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">schedule_type = fixed_intervals</code>: The number of future billing cycles in one <a href="/docs/api/advance_invoice_schedules">interval</a>. The schedule is created such that the total number of billing cycles in the schedule does not exceed the <a href="/docs/api/subscriptions/subscription-object#remaining_billing_cycles">remaining_billing_cycles</a> of the subscription. .</li> </ul>
Default 1
invoice_immediatelyboolean<p class="mb-2">Whether the charge should be invoiced immediately or added to <a href="/docs/api/unbilled_charges"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">unbilled_charges</code></a>. Applicable only when <a href="/docs/api/subscriptions/charge-future-renewals#schedule_type"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">schedule_type</code></a> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">immediate</code> .</p>
schedule_typestring<p class="mb-2">The type of advance invoice or advance invoicing schedule.</p> * immediate - <p class="mb-2">Charge immediately for the number of billing cycles specified by <a href="/docs/api/subscriptions/charge-future-renewals#terms_to_charge"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">terms_to_charge</code></a> .</p> * specific_dates - <p class="mb-2">Charge on <a href="/docs/api/subscriptions/charge-future-renewals#specific_dates_schedule_date">specific dates</a>. For each date, specify the <a href="/docs/api/subscriptions/charge-future-renewals#specific_dates_schedule_terms_to_charge">number of billing cycles</a> to charge for. Up to 5 dates can be configured.</p> * fixed_intervals - <p class="mb-2">Charge at fixed intervals of time. Specify the <a href="/docs/api/subscriptions/charge-future-renewals#terms_to_charge">number of billing cycles</a> that constitute an interval and the number of <a href="/docs/api/subscriptions/charge-future-renewals#fixed_interval_schedule_days_before_renewal">days before each interval</a> that the invoice should be generated. Also specify <a href="/docs/api/subscriptions/charge-future-renewals#fixed_interval_schedule_end_schedule_on">when the schedule should end</a> .</p>
One ofimmediatespecific_datesfixed_intervals
fixed_interval_scheduleobjectParameters for fixed_interval_schedule
number_of_occurrencesinteger (int32)<p class="mb-2">The number of advance invoices to generate. The schedule is created such that the total number of billing cycles in the schedule does not exceed the <a href="/docs/api/subscriptions/subscription-object#remaining_billing_cycles"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">remaining_billing_cycles</code></a> of the subscription. This parameter is applicable only when <a href="/docs/api/advance_invoice_schedules/advance_invoice_schedule-object#fixed_interval_schedule_end_schedule_on"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">fixed_interval_schedule[end_schedule_on]</code></a> = <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">after_number_of_intervals</code></p>
days_before_renewalinteger (int32)The number of days before each interval that advance invoices are generated.
end_schedule_onstring<p class="mb-2">Specifies when the schedule should end.</p> * after_number_of_intervals - <p class="mb-2">Advance invoices are generated a <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">specified number of times</code></p> * subscription_end - <p class="mb-2">Advance invoices are generated for as long as the subscription is active.</p> * specific_date - <p class="mb-2">End the advance invoicing schedule on a <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">specific date</code> .</p>
One ofafter_number_of_intervalsspecific_datesubscription_end
end_dateinteger (unix-time)<p class="mb-2">The date when the schedule should end. Advance invoices are not generated beyond this date. It must be at least 1 day before the start of the last billing cycle of the subscription and also within 5 years from the current date. This parameter is only applicable when <a href="/docs/api/advance_invoice_schedules/advance_invoice_schedule-object#fixed_interval_schedule_end_schedule_on"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">fixed_interval_schedule[end_schedule_on]</code></a> = <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">specific_date</code> .</p>
specific_dates_scheduleobjectParameters for specific_dates_schedule
terms_to_chargearray<integer (int32)><p class="mb-2">The number of billing cycles to charge for, on the date specified. Applicable only when <a href="/docs/api/advance_invoice_schedules/advance_invoice_schedule-object#schedule_type"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">schedule_type</code></a> is specific_dates.</p>
datearray<integer (unix-time)><p class="mb-2">The unique id of the member of the advance_invoice_schedule array which corresponds to the specific_dates_schedule that you intend to modify. Only applicable when <a href="/docs/api/advance_invoice_schedules/advance_invoice_schedule-object#schedule_type"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">schedule_type</code></a> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">specific_dates</code> .</p>
{
"terms_to_charge": null,
"invoice_immediately": null,
"schedule_type": null,
"fixed_interval_schedule": null,
"specific_dates_schedule": null
}
Response
Returns 200 with an object. Read it in later steps with {{advanceInvoiceEstimate.response.data.<field>}}.
estimateobjectDuring the process of signing up customers to subscriptions, use the Estimates API to evaluate the details of the purchase before actually signing them up. The details returned by the API include the invoice amounts, next billing date and unbilled charges. For example, consider that you are creating a new subscription or update an existing one. Use the Estimates API before that to deduce the details such as the amount the customer would be charged, the state the subscription would be in after creation or updation, and so on. If you have configured the [Avalara integration](https://www.chargebee.com/docs/2.0/avalara.html), Chargebee retrieves the tax amount from Avalara for the invoice. This counts against your Avalara API limits.
created_atinteger (unix-time)requiredThe time at which this estimate got generated
subscription_estimateobject9 fieldsRepresents the subscription details when the 'estimate' operations are invoked.
subscription_estimatesarray<object>9 fieldsIs a list of estimated subscriptions i.e., an array of *subscription_estimate* objects. It is generated when 'Create an estimate for purchase' operation is invoked
invoice_estimateobject18 fieldsRepresents the preview of the invoice generated immediately when the 'estimate' operations are invoked.
invoice_estimatesarray<object>18 fieldsIs a list of estimated invoices i.e., an array of *invoice_estimate* objects. It is generated when 'Create an estimate for unbilled charges' operation is invoked
payment_schedule_estimatesarray<object>7 fields<p class="mb-2"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">payment_schedule_estimate</code> is used to hold the details related to payment schedules for an invoice. It will contain a list of <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">payment_schedules</code> resources.</p> <span featureId="cb-payment-schedules" isMicro="true"></span>
next_invoice_estimateobject18 fieldsRepresents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
credit_note_estimatesarray<object>16 fieldsRepresents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.
unbilled_charge_estimatesarray<object>25 fieldsRepresents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the 'Subscription renewal estimate' operation.
{
"estimate": null
}
Need more? See the Chargebee guide for connection setup and behaviour shared by every action.