> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# order_cancel

> Cancel an order. `restock` has to be stated: true returns the items to inventory, false leaves stock as it is. Shopify does this in the background and answers with a job, so no errors means accepted rather than finished. Cancelling cannot be undone.

<div className="tool-route"><span className="tool-row-method" data-method="POST">POST</span><code>{"/admin/api/2026-07/graphql.json"}</code></div>

```python shopify_order_cancel.py theme={null}
from charter.packs import shopify

result = await shopify.order_cancel.ainvoke({"variables": ...})
```

<Note>
  Posts a GraphQL document to `POST /admin/api/2026-07/graphql.json`, as every tool in this pack does.
</Note>

## Body

<div className="reference-table">
  | Field                                                             | Type                                                                        | Description          |
  | ----------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------- |
  | `variables` <span className="required" title="required">\*</span> | [OrderCancelVariables](/charter/charter/packs/shopify/objects#ordercancelvariables) | The order to cancel. |
</div>
