Preview and Customize a Contract's Invoice Schedule

POST /contracts/preview-invoice-schedule returns the invoice schedule a contract would produce — the
invoices, their issue dates, and the lines on each — without creating the contract or persisting
anything. It takes the same body as POST /contracts.

POST /contracts now accepts an optional invoice_schedule, so a previewed schedule can be edited and
submitted back to control how a full-scope contract bills. Omit it to keep the computed schedule.

What can be changed:

  • Invoices can be split, merged, added, or dropped, and issue dates, descriptions, and billing periods
    edited. Issue dates must be distinct, within the contract period, and outside any closed book period.
  • For each contract item, its FIXED line totals must still add up to the item's computed value —
    amounts are redistributed, not changed. Total billed, revenue recognition, and TCV are unaffected.
    On each line, total_amount must equal unit_amount × quantity; discounted lines can be regrouped
    but not re-priced.
  • USAGE and USAGE_COMMITMENT billing is computed by Rillet, must not be submitted, and is kept
    as computed.

Give each entry in items an id — required on the preview request and when submitting an
invoice_schedule — and echo it back as contract_item_id on every FIXED line.

Applies to V4 only.