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

# Shopify: Cancel Order

Cancel an order in your Shopify store. Supports restocking, refunds, customer notification, and staff notes. Ideal for: order management, fraud prevention, customer service, inventory recovery. Required scope: write_orders.

![Shopify: Cancel Order logo](https://ai-icon.b3.fun/logo/shopify)
Catalog action Integrations shopify

Cancel an order in your Shopify store. Supports restocking, refunds, customer notification, and staff notes. Ideal for: order management, fraud prevention, customer service, inventory recovery. Required scope: write_orders.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `shopify-cancel-order` |
| Category | Integrations |
| Connector | `shopify` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `shopify`, `ecommerce`, `orders`, `write` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `orderId` | `string` | Yes | Order GID to cancel \(e.g., gid://shopify/Order/123\) |
| `reason` | `string` | Yes | Reason for canceling the order |
| `restock` | `boolean` | No | Whether to restock the order's line items. Default: false |
| `refund` | `boolean` | No | Whether to refund the order payment. Default: false |
| `notifyCustomer` | `boolean` | No | Whether to notify the customer about the cancellation. Default: false |
| `staffNote` | `string` | No | Note for staff about the cancellation |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | `boolean` | Yes | Whether the order cancellation was initiated successfully |
| `data` | `object` | No | Cancellation job data |
| `exports` | `object` | No | Exported values from the action |

## Examples

**Workflow node**

```json
{
  "type": "shopify-cancel-order",
  "payload": {
    "orderId": "example-orderId",
    "reason": "CUSTOMER"
  },
  "children": [],
  "connector": {
    "type": "shopify",
    "id": "conn_shopify"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/shopify-cancel-order/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "orderId": "example-orderId",
    "reason": "CUSTOMER"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.