Preview an order amendment

Compiles amendment intents into a plan (operations, money effects, credit effects, state diff) without executing. The returned planHash can be passed to the execute endpoint for two-phase, drift-guarded execution.

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.

Response

200
planVersiondouble
Version of the plan format. Currently 1.
orderIdstring
orderVersiondouble
effectiveDatestring
When the amendment takes effect.
operationsobject
Structural writes the amendment executes.
moneyEffectslist of objects or null

Mid-cycle money the amendment moves.

creditEffectslist of objects or null
Credit entitlement changes the amendment causes.
treatmentsResolvedlist of objects or null
The resolved choice for every treatment axis, with its source.
stateDifflist of objects or null

Before and after billed configuration. Not included in planHash.

planHashstring

Pass this to execute for two-phase drift protection.

usageEffectslist of objects or nullOptional

How un-invoiced usage is handled for repriced metered attributes.

Errors

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