Orders
An order is the deal you’ve agreed with a customer: which prices and rate cards they pay, from when to when, and how they’re invoiced. Each price or rate card on it is an order line. Nothing in your catalog bills anyone until an order puts it on a customer, and a new order bills nothing until you activate it, so you can build and check a deal before it goes live.
Use an order to:
- Start billing a customer by putting prices, rate cards or a plan on them and activating the order.
- Record a negotiated deal with its discounts and spend commitments, using negotiated pricing and commits created with the order.
- Change what a customer pays mid-term with an amendment that previews the exact proration before it’s applied.
- Sell seats by putting a seat price on the order and assigning seats to people.
Orders are in the orders=v1 private beta: send Paid-Beta: orders=v1 with each request.
Creating an order on rate cards is in the internal rate_cards=v1 preview: send Paid-Beta: rate_cards=v1 and an Idempotency-Key. In the preview, create saves the order and activates it in one call, on a monthly billing cycle. It needs at least one rateCard line, and a price line can only add a recurring price that grants credits. If billing can’t confirm the activation, it returns a retryable 503: send the same request with the same key.
How an order works
- You create a draft. It names the customer, the term (
startsAtto the exclusiveendsAt), the billing cycle and the lines. A draft is inert: it bills nothing and you can change anything on it. - You activate it. Paid checks the customer and every line, then starts billing. From then on, what’s billed changes only through amendments.
- It invoices on its billing cycle. Recurring fees are invoiced in advance by default, usage in arrears, and one-time charges straight away.
- It ends on its own at
endsAt, with a final invoice for the usage in its last cycle. An order without anendsAtruns until you amend it.
Create an order
Clausebase signs Halberd LLP for 2027: contract review priced per page on tiers, a monthly platform fee and 25 reviewer seats, invoiced monthly on Net 45 terms against Halberd’s purchase order.
API
Dashboard
Create an order with the customer, the term, the billing cycle and the lines. It’s created as a draft.
Store the ord_ ID. Anywhere the API takes an order in its path, it also accepts your externalId.
When the deal is signed, activate the order:
It returns the order with status: "active", or 202 with status: "activating" if billing takes longer to confirm.
Send lines, a plan, or both. At least one is required.
Order lines
Each line is a price or a rateCard. A line bills from the order’s start to its end unless you give it its own startsAt or endsAt, which must fall inside the order.
Responses add each line’s id, the plan it came from, endedByAmendment once an amendment ends it, and, for a one-time line, charged with the invoice it was charged on. Ended lines stay on the order, so it always shows the full history of what was billed. Orders created with the legacy API return their lines as type: "legacy", with the pricing they were created with.
Term and billing cycle
startsAt is when billing starts. It can be in the past: when you activate the order, usage from events already received since startsAt is billed, and the first invoice covers the periods that have passed. endsAt is exclusive, so an order for 2027 ends at 2028-01-01T00:00:00Z. Leave it out for an order with no end.
billingCycle sets how often the order invoices:
Usage prices and rate cards have no interval of their own, so they’re invoiced once per cycle. A recurring price’s interval must divide the cycle evenly or be a whole multiple of it: a monthly fee on an annual cycle is charged 12 times on each invoice, and an annual fee on a monthly cycle is charged on the invoice where each year starts. An interval that’s neither, such as every 2 months on a quarterly cycle, can’t go on the order.
currency defaults to the customer’s currency, and every line’s price or rate card must be offered in it.
Invoice settings
Start from a plan
Send a plan instead of, or as well as, lines to copy a plan’s lines onto the order. quantities, keyed by price, replaces the plan’s default quantities:
The response returns plan as the plan and the version the order was built from. To move a running order to another plan, use a changePlan amendment.
Negotiated terms
Terms you negotiate are sent with the order, so they exist before the first invoice. They’re created with the draft and take effect when it’s activated:
negotiatedPricing: up to 50 contracted prices, discounts and surcharges that apply to this order only. Each targets something the order bills. See Introduction to pricing.commits: up to 10 spend commitments, either an invoiced minimum or a prepaid amount. See Commits.
Halberd’s 15% discount on the platform fee for the whole term:
An entry with no dates starts with the order and ends with it. Sending commits needs the commits=v1 beta. To add terms to an order that’s already active, send them with an amendment.
The order lifecycle
- Activate. Activation fails unless the customer is active and every line’s price or rate card is active and offered in the order’s currency. An order that returns
activatingmoves toactivewhen billing confirms, or back todraftif activation fails. - Deactivate. Deactivate returns an active order to draft, to undo a mistaken activation. It’s allowed only while
startsAtis still in the future and no invoice has been issued. - Pause and resume. Pause stops invoicing without ending the order. Usage is still recorded, and is invoiced when you resume.
- End. An order ends at
endsAtwith no action from you. To end it early or extend it, amend its term.
A customer can have several active orders, as long as they don’t price the same usage over the same dates. Activating or amending an order whose lines would bill the same product, meter and workflow outcome as another of the customer’s orders, over overlapping dates, fails with meter_already_priced_for_customer, so no usage is billed twice.
How it bills
Halberd’s order is on a monthly cycle from 1 January. Pages are priced on graduated tiers: $0.40 a page for the first 10,000 pages a month, and $0.25 a page after that. The platform fee is $2,000.00 a month and each reviewer seat $40.00 a month, both in advance. Halberd’s lawyers review 14,200 pages in January. The invoice issued on 1 February carries January’s pages in arrears and February’s fees in advance:
The first line shows the order line’s displayName. The other two have none, so they show their prices’ labels. The PO number PO-88213 is printed on the invoice. See Invoices for everything else that can appear on one.
Change or delete an order
On a draft, update any field. lines replaces the whole list.
Once the order is active, you can update its name, externalId, billTo, paymentTerms, invoiceSettings, purchaseOrderNumber, billingContacts, metadata and each line’s displayName. A new label applies to invoices issued afterwards. Everything that changes what’s billed, such as lines, quantities, prices, dates, the billing cycle or the currency, changes through an amendment.
Delete a draft you no longer need. It’s removed for good, and the commits created with it are archived. Only drafts can be deleted: an order that has billed stays on record.