Amend an order

Executes amendment intents against an order. One-shot by default; pass the previewed planHash to require the recomputed plan to match (409 PLAN_CONFLICT on drift).

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Path parameters

orderIdstringRequired

Display id of the order (for example ord_5rLZXDFSHNw). Line and attribute ids in amendment bodies are UUIDs from the options response.

Request

Body
orderVersionintegerRequired>=1

Must match orderVersion from the options response. Returns 409 if the order has been amended since.

intentslist of objectsRequired
At least one intent, discriminated by type.
defaultTreatmentenumOptional

Recurring charges pick next-cycle vs settle-now. Usage price changes pick new usage only vs the whole current period.

planHashstringOptional

From preview. When set, execute recomputes the plan and returns 409 PLAN_CONFLICT if billing state has drifted. Omit only for one-shot execute.

Response

200
orderIdstring
Display id of the order.
amendmentIdstring
UUID of the recorded amendment.
versiondouble
Order version after the amendment.
effectiveDatestring
When the amendment took effect.
endedLineIdslist of strings or null
UUIDs of order lines the amendment ended.
createdLineIdslist of strings or null
UUIDs of order lines the amendment created.
planobject or null
The compiled plan that was executed. JSON null when no plan was computed.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error