Skip to main content

cancelFulfillment

Cancels a fulfillment in the V2 fulfillments state machine.

Transitions a fulfillment to the "canceled" state. Valid source states are "allocated", "ready", "in_progress", and "failed_to_fulfill".

For cancellations from "allocated", "ready", "in_progress" or "failed_to_fulfill", allocated inventory is always released.

Requirements​

  • User must have orders:fulfill_order permission
  • Cancelling from "in_progress" additionally requires orders:revert_fulfillment_to_allocated, since the fulfillment is pulled back from the system holding it before it can be cancelled
  • Company context must be provided (via X-Company-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
  • proceed_without_integration (optional): cancel even when the system fulfilling it does not accept cancellations

Behavior​

  • Transitions fulfillment to "canceled" state
  • Releases inventory unconditionally from "allocated"/"ready"/"in_progress"/"failed_to_fulfill"
  • Cancelling from "in_progress" pulls the fulfillment back from the system holding it first, so a system that does not accept cancellations is refused until proceedWithoutIntegration is set
  • Returns the canceled fulfillment

Error Scenarios​

  • **E_INTEGRATION_CANNOT_CANCEL**: when the fulfillment is with a system that does not accept cancellations and proceedWithoutIntegration was not set. Ask the user to confirm and retry.
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.