--- title: OrderCancelUserError - GraphQL Admin description: Errors related to order cancellation. api_version: 2025-10 api_name: admin type: object api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderCancelUserError md: https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderCancelUserError.md --- # Order​Cancel​User​Error object Requires `read_orders` access scope or `read_marketplace_orders` access scope. Errors related to order cancellation. ## Fields * code [Order​Cancel​User​Error​Code](https://shopify.dev/docs/api/admin-graphql/latest/enums/OrderCancelUserErrorCode) The error code. * field [\[String!\]](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The path to the input field that caused the error. * message [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null The error message. *** ## Map No referencing types *** ## Mutations * [order​Cancel](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderCancel) mutation Cancels an order, with options for refunding, restocking inventory, and customer notification. *** Caution Order cancellation is irreversible. An order that has been cancelled can't be restored to its original state. *** Use the `orderCancel` mutation to programmatically cancel orders in scenarios such as: * Customer-requested cancellations due to size, color, or other preference changes * Payment processing failures or declined transactions * Fraud detection and prevention * Insufficient inventory availability * Staff errors in order processing * Wholesale or B2B order management workflows The `orderCancel` mutation provides flexible refund options including refunding to original payment methods or issuing store credit. If a payment was only authorized (temporarily held) but not yet charged, that hold will be automatically released when the order is cancelled, even if you choose not to refund other payments. The mutation supports different cancellation reasons: customer requests, payment declines, fraud, inventory issues, staff errors, or other unspecified reasons. Each cancellation can include optional staff notes for internal documentation (notes aren't visible to customers). An order can only be cancelled if it meets the following criteria: * The order hasn't already been cancelled. * The order has no pending payment authorizations. * The order has no active returns in progress. * The order has no outstanding fulfillments that can't be cancelled. Orders might be assigned to locations that become [deactivated](https://help.shopify.com/manual/fulfillment/setup/locations-management#deactivate-and-reactivate-locations) after the order was created. When cancelling such orders, inventory behavior depends on payment status: * **Paid orders**: Cancellation will fail with an error if restocking is enabled, since inventory can't be returned to deactivated locations. * **Unpaid orders**: Cancellation succeeds but inventory is not restocked anywhere, even when the restock option is enabled. The committed inventory effectively becomes unavailable rather than being returned to stock at the deactivated location. After you cancel an order, you can still make limited updates to certain fields (like notes and tags) using the [`orderUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderUpdate). For partial refunds or more complex refund scenarios on active orders, such as refunding only specific line items while keeping the rest of the order fulfilled, consider using the [`refundCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/refundCreate) mutation instead of full order cancellation. Learn how to build apps that integrate with [order management and fulfillment processes](https://shopify.dev/docs/apps/build/orders-fulfillment). *** ## <\~> OrderCancelUserError Mutations ### Mutated by * <\~>[order​Cancel](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderCancel) *** ## Interfaces * [Displayable​Error](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/DisplayableError) interface *** ## ||-OrderCancelUserError Implements ### Implements * ||-[Displayable​Error](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/DisplayableError)