Skip to main content

supplyCancelPurchaseOrder

Cancels one or more purchase orders.

This mutation processes cancellations asynchronously in the background. The response includes a process ID that can be used to track the operation status.

Authentication

Requires the supply:cancel_po permission.

Asynchronous Processing

Since this operation can affect multiple purchase orders, it runs in the background. If any purchase order fails to cancel, you will receive a notification with details about which orders could not be canceled and the reasons.

Business Rules

  • Purchase orders must exist and belong to your brand.
  • Purchase orders cannot be canceled if they were already deleted previously.
  • Purchase orders can only be canceled if they are in 'draft', 'in_review', or 'issued' status.
  • Once a purchase order reaches 'confirmed' status or beyond, it cannot be canceled.

Possible Errors

  • **At least one Purchase Order must be specified**: The ids array cannot be empty.
  • **Purchase Order not found**: One or more specified purchase orders do not exist.
  • **Purchase Order does not belong to this brand**: One or more purchase orders belong to a different brand.
  • **Purchase Order was already deleted**: One or more purchase orders were previously deleted.
  • **Purchase Order was already canceled**: One or more purchase orders were previously canceled.
  • **Purchase Order cannot be canceled in current status**: One or more purchase orders are in a status that does not allow cancellation.
supplyCancelPurchaseOrder(
input: CancelPurchaseOrderInput!
): AsynchronousActionResponse

Arguments

supplyCancelPurchaseOrder.input ● CancelPurchaseOrderInput! non-null input

Parameters for CancelPurchaseOrder

Type

AsynchronousActionResponse object

Asynchronous action response type