Skip to main content

cancelFulfillment

Cancels a fulfillment in the V2 fulfillments state machine.

Transitions a fulfillment to the "cancelled" state. Valid source states are "allocated", "sent", and "failed_to_fulfill".

For cancellations from "allocated" or "failed_to_fulfill", allocated inventory is always released. For cancellations from "sent", inventory release is caller-controlled via the releaseInventory argument (default false, retaining goods-in-transit semantics).

Requirements

  • User must have fulfill_order permission
  • Valid brand context must be provided (via argument or X-Brand-Id header)
  • Fulfillment must exist and be in a cancellable state

Arguments

  • fulfillment_id (required): The ID of the fulfillment to cancel
  • order_id (required): The ID of the order the fulfillment belongs to
  • metadata (optional): JSON metadata for the cancellation
  • release_inventory (optional, default false): When cancelling from "sent", release inventory allocations instead of retaining them. Has no effect when cancelling from "allocated" or "failed_to_fulfill" (release is unconditional on those paths).

Behavior

  • Transitions fulfillment to "cancelled" state
  • Releases inventory unconditionally from "allocated"/"failed_to_fulfill"
  • Releases inventory from "sent" only when releaseInventory: true
  • Returns the cancelled fulfillment
cancelFulfillment(
input: CancelFulfillmentInput!
): OrderFulfillment!

Arguments

cancelFulfillment.input ● CancelFulfillmentInput! non-null input common

Parameters for CancelFulfillment

Type

OrderFulfillment object orders

This type represents an order fulfillment. An order can have multiple fulfillments, each one associated with a warehouse and a party that fulfilled the order.