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_orderpermission - 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-Idheader) - Fulfillment must exist and be in a cancellable state
Arguments
fulfillment_id(required): The ID of the fulfillment to cancelorder_id(required): The ID of the order the fulfillment belongs tometadata(optional): JSON metadata for the cancellationproceed_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
proceedWithoutIntegrationis set - Returns the canceled fulfillment
Error Scenarios
- **
E_INTEGRATION_CANNOT_CANCEL**: when the fulfillment is with a system that does not accept cancellations andproceedWithoutIntegrationwas 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.