fulfillment-orders

Cancel a fulfillment order (synchronous)

Cancels a fulfillment order as a CANCELLED transition validated against the state machine version pinned on the FO. A required free-text reason plus any free-form metadata are captured on an immutable timeline event (FulfillmentOrderTrackingEvent — the cancellation moment is previousStatus; the server-validated reason always wins over a same-named metadata key) and echoed back in the response metadata. On enter, the CANCELLED state releases the inventory reservation (RELEASE_INVENTORY); the transition, the timeline event and the stock release run in a single transaction. A fulfillment order at or after INVOICED has no declared edge to CANCELLED and is rejected with 422. accountCode and the actor (user or service account) come from the JWT.

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

Path parameters

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

Fulfillment 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

Fulfillment order cancelled.

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

Changes

Changed in 2 of the 9 revisions of this API.7

    • added the required property event_id to the response with the 200 status

      response-required-property-added

    • added the required property id to the response with the 200 status

      response-required-property-added

    • added the required property metadata to the response with the 200 status

      response-required-property-added

    • added the required property previous_status to the response with the 200 status

      response-required-property-added

    • added the required property status to the response with the 200 status

      response-required-property-added

    • added the required property updated_at to the response with the 200 status

      response-required-property-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 36 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog