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

# Shopify orders webhook (tags chat-attributed orders)

> Raw JSON body (2 MB limit) verified against x-shopify-hmac-sha256. Orders without _stateset_* note attributes are acknowledged and skipped…

Raw JSON body (2 MB limit) verified against `x-shopify-hmac-sha256`. Orders without
`_stateset_*` note attributes are acknowledged and skipped. Attributed orders are
recorded as an analytics event and tagged in Shopify; a tagging failure answers `202`.

### Headers

**x-shopify-topic** `string`

**x-shopify-shop-domain** `string`

### Request body

`object`

A Shopify Order resource. Only `id`, `name`, `note_attributes`, `tags` and customer fields are read.

### Response

`object | object`

**ok** `boolean` *required*

Fixed value: `true`.

**tagged** `boolean` *required*

Fixed value: `true`.

**tags** `string[]` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | Processed or skipped |
| `202` | Attributed order recorded but Shopify tagging did not succeed |
| `400` | Body is not valid JSON |
| `401` | HMAC verification failed |
| `500` | Unhandled error |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/chat-widget.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.example.com/api/webhooks/shopify/orders' \
  --header 'x-shopify-hmac-sha256: YOUR_API_KEY' \
  --header 'x-shopify-topic: REPLACE_WITH_X_SHOPIFY_TOPIC' \
  --header 'x-shopify-shop-domain: REPLACE_WITH_X_SHOPIFY_SHOP_DOMAIN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

```json 200 theme={null}
{
  "ok": true,
  "tagged": true,
  "tags": [
    "priority"
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.