Skip to navigation

Amend an order

An amendment changes what an active order bills: adding or ending a line, changing a quantity, moving to a new price or plan, or changing the term. You preview it first and see every proration credit and charge it will cause, then apply exactly what you previewed. Amendments never edit the past: ended lines stay on the order, and every amendment stays readable, so you can always see why an invoice says what it says.

Use an amendment to:

  • Sell more mid-term, such as extra seats or a credit top-up, with updateQuantity or addLine.
  • Reprice a customer by moving a line to a new price with replacePrice, or the whole order to another plan with changePlan.
  • Renew, extend or end early by moving the order’s endsAt with updateTerm.
  • Add negotiated terms to a running order: new negotiated pricing entries and commits.

Amendments are in the orders=v1 private beta: send Paid-Beta: orders=v1 with each request.

How an amendment works

  1. Preview. You send the changes and the order version you last read. Paid works out the resulting lines, the proration credits and charges, and what happens to each commit, and changes nothing.
  2. Apply. You send the same changes with the preview’s previewToken. They take effect immediately and the order’s version goes up by one.
  3. Record. The amendment is saved with its changes, when it took effect and who made it. Lines it ended keep their history.

Amend an order

On 15 March 2027, Halberd LLP buys 10 more reviewer seats from Clausebase, taking its order from 25 seats to 35.

Preview the amendment with the changes and the order’s current version as expectedVersion:

POST /v1/orders/ord_5Kp2Wz/amendments/preview
{
"expectedVersion": 1,
"changes": [
{
"type": "updateQuantity",
"updateQuantity": { "line": "ordl_3Tb6Yp", "quantity": 35 }
}
]
}

The preview returns the order’s lines as they would be afterwards, a previewToken, and the money it moves in moneyEffects, each in integer minor units (-54839 is a credit of $548.39):

"moneyEffects": [
{ "line": "ordl_3Tb6Yp", "amount": { "amount": -54839, "currency": "usd" }, "invoice": "nextInvoice" },
{ "line": "ordl_3Tb6Yp", "amount": { "amount": 76774, "currency": "usd" }, "invoice": "nextInvoice" }
]

When the numbers are right, create the amendment with the same body and the previewToken:

{
"expectedVersion": 1,
"previewToken": "amdp_7Yt3Hc",
"changes": [
{
"type": "updateQuantity",
"updateQuantity": { "line": "ordl_3Tb6Yp", "quantity": 35 }
}
]
}

The preview also returns commits, with what happens to each commit, negotiatedPricing as it will be after the changes, warnings for consequences to review, and, for a plan change, a direction of upgrade, downgrade or lateral.

Changes

One amendment can make several changes. They’re applied together, or not at all.

typeDoes
addLineAdds a price or rate card line, with the same fields as an order line. A one-time price on it is charged once, when the amendment is applied, and never prorated.
endLineEnds a line. It stays on the order with endedByAmendment set.
updateQuantityChanges the quantity of a recurring price with a unit, such as seats.
replacePriceEnds a line and continues it on another price. Usage before the amendment is billed at the old price, and usage after it at the new one.
updateTermMoves the order’s endsAt. With extendLines: true, lines that ended with the order move too; by default (false), lines keep their own end dates.
updateQuantityLimitsChanges a line’s quantityLimits, within the price’s own. They can’t exclude the line’s current quantity.
changePlanMoves the order to another plan: lines on both plans are kept, the old plan’s other lines end and the new plan’s are added. carryQuantities (default true) keeps compatible quantities and seat assignments. Needs the plans=v1 beta.
addNegotiatedPricingAdds a negotiated pricing entry, with the same fields as on the order. It must send startsAt.
endNegotiatedPricingEnds the entry with a key that’s in effect at endsAt. An endsAt equal to the entry’s own startsAt withdraws an entry that hasn’t started.

An amendment can also send commits (up to 10), the same array you send when you create an order. They start when the amendment takes effect. To change or end existing commits, use commits directly.

Negotiated pricing entries are never edited. To renegotiate a term, end its entry and add one with the same key from the same instant, in one amendment. Both dates must be no earlier than the end of the order’s last invoiced period, so issued invoices keep the terms they used.

Proration

proration is prorate by default. When a recurring charge changes mid-period, Paid credits the unused part of the old charge and charges the remaining part of the new one, by day, counting the day the amendment takes effect. Each is rounded half-up to the minor unit once, on its invoice line. Set proration: "none" to change the lines without any credit or charge for the current period.

Usage isn’t prorated: it’s billed for what was used before and after the change. One-time charges are never prorated.

How it bills

Halberd’s reviewer seats are $40.00 each a month, on a monthly cycle. The amendment takes effect on 15 March, so 17 of March’s 31 days remain (15 to 31 March, counting the 15th):

StepValue
Old charge for March25 × $40.00 = $1,000.00
Credit for the unused days$1,000.00 × 17 ÷ 31 = $548.387… → −$548.39
New charge for March35 × $40.00 = $1,400.00
Charge for the remaining days$1,400.00 × 17 ÷ 31 = $767.741… → $767.74
Net effect, on the 1 April invoice$767.74 − $548.39 = $219.35
April onwards35 × $40.00 = $1,400.00 a month in advance

These are the two moneyEffects in the preview, and both land on the nextInvoice.

Commits and term changes

Changing the term changes the commits on the order:

  • Shortening the order ends each commit on the new end date. Its amount keeps what was committed, and proratedAmount holds that amount prorated by day, kept exact rather than rounded. An invoiced minimum is then trued up against the exact prorated amount, rounded half-up once on the true-up line.
  • Extending the order leaves its commits unchanged, with the same amount and dates. Add a commit for the extra time in the same amendment if the deal has one.

The preview lists each commit’s outcome as prorated (with its new amount, an exact decimal string in minor units), unchanged or added, and warns when an extension leaves part of the new term without a commit the original term had.

Two people, one order

expectedVersion makes sure an amendment is based on the order as it is now. If someone else amended the order after you read it, your preview or amendment fails and nothing changes. A previewToken works the same way: if the order changed between your preview and your amendment, the amendment fails. In both cases, preview again and apply the new preview.

If billing can’t be reached, the preview or amendment returns 503 and nothing changes. Retry it.

Read the history

List amendments to see every change to an order, newest first, or retrieve one. Each records its changes, effectiveAt, the order’s versionAfter, and its source:

source.typeMade by
apiA request to the API.
dashboardSomeone on your team, in the dashboard.
autoTopUpA credit auto top-up that bought credits, named in source.autoTopUp.

Amendments take effect when you apply them. They can’t be scheduled for a future date, and can’t be undone: to reverse one, apply another.