Skip to main content
Billing terms say how a binding subscription commitment is paid: when, how much, and on which invoice. Each term is a rule, such as “$300 upfront” or “the rest monthly in arrears”. Flexprice expands the terms into instalments, each one dated amount, and the instalments always add up to the commitment’s value. Usage within the commitment is then billed at $0, so the commitment is paid only through its instalments. Benefits:
  • Contract-shaped schedules: Upfront payments, deposits, quarterly payments in advance, milestones, or any mix of them
  • Exact totals: A remainder term takes whatever the other terms leave, and its last instalment absorbs rounding
  • Delivery per term: Bill instalments on the subscription invoice, or on their own invoice on the exact date
  • Preview before saving: See every instalment, with its date, amount and invoice label, before the commitment is created or the terms are changed
  • Editable: Replace the terms of an active commitment. Instalments already invoiced and their invoices are kept
  • Traceable invoice lines: Every instalment line points to its instalment, and from there to its term and commitment

Concepts

Requirements

  • The commitment is binding (binding: true) with collection_method: billing_terms.
  • The commitment has an end_date. An open-ended commitment has no finite value to split.
  • The request carries 1 to 100 billing terms.

Creating a Commitment With Billing Terms

Send billing_terms with Create commitment, or inside commitments on Create subscription. This commitment is worth $100 a month for 2027, a total of $1,200, paid as $300 at signing and the rest at the end of every month:
The terms produce 13 instalments: $300 on 1 Jan 2027, then 12 instalments of $75 on the 1st of each month from February 2027 to January 2028. The response returns the commitment with its billing_terms and instalments, and commitment.created, billing_terms.created and one billing_instalment.created per instalment are sent. Use Preview commitment with the same body to see the instalments without creating anything.

Billing Term Fields

Amounts

  • A fixed value is money in the commitment’s currency, greater than 0, with no more decimals than the currency allows.
  • On a recurring term, the fixed value is per instalment, so the term’s amount is value × the number of steps.
  • At most one term is the remainder. Its amount is total_amount minus every other term, and it must be greater than 0.
  • Without a remainder term, the terms must add up to total_amount exactly.
  • A recurring remainder is divided across its steps. even gives every step the same amount. proportional sizes each step by the commitment’s value in it, so a short first month bills less than a full one. Either way, the last instalment absorbs the rounding: $1,000 over 3 months is $333.33, $333.33 and $333.34.
value_type: percentage is reserved. A percentage term returns percentage terms are not supported yet.

Steps of a Recurring Term

A recurring term cuts its [start_date, end_date) window into steps of period_count periods. The last step can be shorter. Which periods it counts depends on where the instalments are billed:
  • On the subscription invoice: the subscription’s billing periods, cut to the commitment’s dates. A monthly term on a subscription billed on the 1st, for a commitment starting 15 Jan, bills a 15 Jan to 1 Feb step, then one step per month.
  • On separate invoices: periods of the subscription’s billing period length, counted from the commitment start. The same term bills on the 15th of each month.

Common Arrangements

All of these collect the $1,200 commitment above:

How Instalments Are Billed

instalment_invoicing on the commitment sets where instalments are billed, and a term can set its own.

On the Subscription Invoice

With subscription_invoice (the default), each subscription invoice carries the instalments whose bill_on is on or before its billing period boundary:
  • An ADVANCE step lands on the invoice that opens it, and an ARREAR step on the invoice that closes it.
  • A once instalment dated mid-period lands on the next period’s invoice.
  • An instalment dated in the past, after an edit or a late trigger, lands on the next invoice.

On Separate Invoices

With separate_invoice, Flexprice checks for due instalments every 15 minutes. It issues one finalized ONE_OFF invoice per instalment, with billing reason BILLING_TERMS, once its bill_on is reached. Use this to bill on the exact date, for example an upfront payment on signing while the monthly instalments go on the subscription invoices.

Invoice Lines

An instalment line has no price. It carries commitment_id and billing_instalment_id, and its service period is the instalment’s. The line is titled with the commitment’s invoice_label, a dash, and the instalment’s label, and carries the commitment’s invoice_description: {n} and {of} in a label number every instalment of the commitment whose label uses them, once and recurring together, in billing order. Without the custom “Signing” label, the same commitment bills “Instalment 1 of 13” through “Instalment 13 of 13”. Usage within the commitment appears at $0, titled with the invoice_label followed by “(covered by commitment)”. No true-up is billed. Usage beyond the commitment is billed at the overage price as usual.
Changing the amount or quantity of an instalment line on a draft invoice returns an instalment line's amount comes from the commitment's billing terms. Edit the billing terms instead. The line’s name, description and period can still be edited.

When an Instalment Counts as Invoiced

An instalment is invoiced only when the invoice carrying it is finalized. Computing a draft invoice doesn’t change it. Finalizing sets instalment_status: invoiced and invoice_id, and sends billing_instalment.invoiced.
  • Trials and pauses: instalments wait while the subscription is trialing or paused. They are billed on the first invoice after the trial or pause ends. Separate invoices are issued only for active subscriptions.
  • Voided invoices: voiding an invoice puts its instalments back to scheduled, so they are billed on the recalculated invoice or the next one.
  • Credit notes: a credit note doesn’t change instalments. A credited instalment stays invoiced.

Viewing Instalments

Get billing terms returns the commitment’s current terms with its scheduled and invoiced instalments. List instalments returns every instalment, cancelled ones included, and filters by status:

Instalment Object

Editing Billing Terms

Terms set up wrong, or a renegotiated payment schedule, are changed with Edit billing terms. An edit replaces the whole set of terms of an active commitment:
  1. Every scheduled instalment is cancelled, and the current terms are archived.
  2. The new terms are expanded against what the invoiced instalments leave of total_amount. A remainder term takes what is left after the invoiced instalments and the other new terms.
  3. A new term without bill_on or start_date starts at the billing period holding the moment of the edit, or the commitment start once the commitment’s term has ended. A recurring term billed on separate invoices starts at the anniversary period holding the edit.
  4. New instalments are numbered after the invoiced ones.
Invoiced instalments and their invoices are never changed. Draft invoices drop the cancelled instalments when they are finalized. On the $1,200 commitment above, the $300 signing payment and the January to April instalments ($600) are on finalized invoices by 10 May. That day the rest moves to quarterly payments in advance:
The eight scheduled $75 instalments are cancelled. The new term covers the $600 left, from 1 May to the end of the commitment, in steps of May to July, August to October, and November to December. It bills $200 on 1 May, 1 Aug and 1 Nov. The 1 May instalment is already due, so it goes on the next invoice. Preview billing terms edit takes the same body and returns the result without saving. Both return the new terms with the invoiced and new instalments, and an edit sends billing_terms.updated, plus billing_instalment.cancelled and billing_instalment.created for each instalment it changes.
An edit is refused when:
  • The commitment is fully invoiced: billing_terms: the commitment is fully invoiced; nothing is left to plan.
  • A draft invoice carrying the commitment’s instalments has a payment that is pending, processing or succeeded. Edit once the invoice is finalized or the payment fails.

Billing the Whole Total Again

An edit plans only what invoiced instalments leave. To bill the full total_amount again, for example after an upfront amount was entered wrong and invoiced:
  1. Void the invoices that carry the commitment’s instalments. Their instalments go back to scheduled. A paid invoice can be voided too.
  2. Edit the billing terms. The edit cancels every scheduled instalment, the voided ones included, and the new terms cover the full total.
Void first, then edit. Editing first plans only what is left, and the voided instalments then come back on top of the new ones.

Triggering a Milestone

A once term with bill_trigger: manual is a milestone, such as a payment due at go-live. Its instalment waits with bill_on set to the commitment’s end_date, so it bills at the end of the term if it is never triggered. Trigger instalment bills it earlier:
  • bill_on defaults to now and must fall within the commitment’s dates.
  • A trigger can only move bill_on earlier. To bill a milestone later, edit the billing terms.
  • The instalment is then billed like any other: on the next subscription invoice, or on its own invoice once due when its delivery is separate_invoice.
  • billing_instalment.updated is sent.

Terminating a Commitment

Terminating a commitment with billing terms:
  1. Cancels every scheduled instalment.
  2. Bills the cancelled instalments that were already due (bill_on on or before effective_at) as one settlement instalment, labeled “Settlement”.
  3. Bills the settlement and the cancellation fee, if any, together on one ONE_OFF invoice with billing reason COMMITMENT_TERMINATION.
Instalments due after effective_at are not billed, and nothing is refunded. The cancellation fee is how a tenant charges for an early end. For a $1,200 commitment terminated on 1 May: To give back an instalment billed before the termination, issue a credit note against its invoice. Voiding the invoice instead puts the instalment back on schedule, and it is billed again.

Subscription Cancellation

  • At period end or on a date: the commitment and its instalments keep billing until the cancellation takes effect. Then the commitment is terminated as above.
  • Immediately: the commitment is terminated at once. The settlement is billed on its own invoice even when the cancellation issues no final invoice.
  • A commitment that already ended: its instalments still scheduled are settled at the commitment’s end.

Webhooks

A billing_terms.* payload carries the owner’s current terms:
Terms are stored as they were sent. Defaults, such as a once term’s bill_on, are applied when the terms are expanded, and show on the instalments. After an edit, the replaced terms have status: archived. A billing_instalment.* payload carries the instalment:

Validation Errors

Errors about one term name its position and field, for example billing_terms[1].split.

Not Supported Yet

  • Percentage terms and percentage cancellation fees
  • Billing terms on open-ended commitments
  • Automatic refunds or credit notes on termination or edit. Issue credit notes against the invoices instead
  • A split that keeps full periods equal and prorates only the first and last. Use a once term for each partial period and a fixed recurring term for the rest

Subscription Commitments

Webhook event catalog