> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.shopify.orders.CancelOrder

- Component: `appmixer.shopify.orders.CancelOrder`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.shopify 4.1.0](https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0/component/appmixer.shopify.orders.CancelOrder>

Cancel an order. Shopify cancels the order in the background, so the order shows as cancelled a moment later. Optionally restock the items and refund the payments.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Order (`id`) | text | Pick an order, or enter its ID: the global ID (gid://shopify/Order/450789469) or the numeric ID from the order's admin URL. |
| Reason (`reason`) | select | Why the order is cancelled. |
| Restock Items (`restock`) | toggle | Return the items of the order to inventory. |
| Refund Payments (`refund`) | toggle | Refund the payments of the order to the original payment methods. |
| Notify Customer (`notifyCustomer`) | toggle | Send the customer the order cancellation e-mail. |
| Staff Note (`staffNote`) | textarea | An internal note about the cancellation, visible to staff only. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.shopify.orders.CancelOrder",
  "description": "Cancel an order. Shopify cancels the order in the background, so the order shows as cancelled a moment later. Optionally restock the items and refund the payments.",
  "author": "Appmixer <info@appmixer.com>",
  "private": false,
  "auth": {
    "service": "appmixer:shopify",
    "scope": [
      "write_orders"
    ]
  },
  "quota": {
    "manager": "appmixer:shopify",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "CUSTOMER",
              "DECLINED",
              "FRAUD",
              "INVENTORY",
              "STAFF",
              "OTHER"
            ]
          },
          "restock": {
            "type": "boolean"
          },
          "refund": {
            "type": "boolean"
          },
          "notifyCustomer": {
            "type": "boolean"
          },
          "staffNote": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "inspector": {
        "inputs": {
          "id": {
            "type": "text",
            "label": "Order",
            "index": 1,
            "tooltip": "Pick an order, or enter its ID: the global ID (gid://shopify/Order/450789469) or the numeric ID from the order's admin URL.",
            "source": {
              "url": "/component/appmixer/shopify/orders/FindOrders?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./FindOrders#ordersToSelectArray"
              }
            }
          },
          "reason": {
            "type": "select",
            "label": "Reason",
            "index": 2,
            "defaultValue": "OTHER",
            "tooltip": "Why the order is cancelled.",
            "options": [
              {
                "label": "Customer changed or cancelled the order",
                "value": "CUSTOMER"
              },
              {
                "label": "Payment declined",
                "value": "DECLINED"
              },
              {
                "label": "Fraudulent order",
                "value": "FRAUD"
              },
              {
                "label": "Items unavailable",
                "value": "INVENTORY"
              },
              {
                "label": "Staff error",
                "value": "STAFF"
              },
              {
                "label": "Other",
                "value": "OTHER"
              }
            ]
          },
          "restock": {
            "type": "toggle",
            "label": "Restock Items",
            "index": 3,
            "defaultValue": false,
            "tooltip": "Return the items of the order to inventory."
          },
          "refund": {
            "type": "toggle",
            "label": "Refund Payments",
            "index": 4,
            "defaultValue": false,
            "tooltip": "Refund the payments of the order to the original payment methods."
          },
          "notifyCustomer": {
            "type": "toggle",
            "label": "Notify Customer",
            "index": 5,
            "defaultValue": false,
            "tooltip": "Send the customer the order cancellation e-mail."
          },
          "staffNote": {
            "type": "textarea",
            "label": "Staff Note",
            "index": 6,
            "tooltip": "An internal note about the cancellation, visible to staff only."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out"
    }
  ],
  "icon": "(data URI omitted)"
}
```
