v9

latestOpenAPI 3.0.0raw.githubusercontent.com2026-07-071292691.1 MB
orders

Cancel an order (synchronous)

Cancels an order as a CANCELLED transition validated by the order state machine version pinned at creation. A required free-text reason plus any free-form metadata are captured on an immutable timeline event (OrderTrackingEvent — the cancellation moment is previousStatus; the server-validated reason always wins over a same-named metadata key) and echoed back in the response metadata. The transition and the event are written in a single transaction. Orders past INVOICED have no declared edge to CANCELLED and are rejected with 422. accountCode and the actor (user or service account) come from the JWT.

post/api/v1/orders/{id}/cancel

Path parameters

idstring uuid required
Example:01920000-0000-7000-8000-000000000000

Order identifier (UUID).

Request body

reasonstring required

Free-text reason for the cancellation. Recorded inside the timeline event metadata.

metadataobject nullable

Free-form cancellation context (e.g. refund_status). Merged verbatim into the timeline event; the server-validated reason always wins over a same-named key here.

Response

Order cancelled.

idstring required
statusstring required
previous_statusstring required
metadataobject required
updated_atstring required
event_idstring required