---
title: Webhooks
description: Refresh storefront content when Shopify products, collections, or metaobjects change, and on request for content Shopify sends no webhook for.
url: "https://vercel.shop/docs/anatomy/webhooks"
docs_index: /llms.txt
lastUpdated: 2026-11-21
type: guide
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

Shopify webhooks make supported Admin changes appear on the storefront without waiting for cached data to expire. The template accepts Shopify notifications at `POST /api/webhooks/shopify` and refreshes the affected product, collection, recommendation, sitemap, or metaobject content.

Webhooks are disabled by default. Without `SHOPIFY_WEBHOOK_SECRET`, the endpoint returns `404`. Edits appear when cached content refreshes or the site is redeployed; cache eviction can make them appear sooner.

## Set up Shopify webhooks

1. Open **Shopify Admin → Settings → Notifications → Webhooks**.
2. Set the destination to `https://your-domain.com/api/webhooks/shopify`.
3. Choose **JSON** as the format.
4. Register the product, collection, and metaobject topics you need.
5. Copy the webhook signing secret into `SHOPIFY_WEBHOOK_SECRET` for that environment.

```bash
SHOPIFY_WEBHOOK_SECRET="your-webhook-secret-here"
```

Register these supported topics:

- `products/create`, `products/update`, and `products/delete`
- `collections/create`, `collections/update`, and `collections/delete`
- `metaobjects/create`, `metaobjects/update`, and `metaobjects/delete`

You can register only the topics your store uses. Changes without a registered topic have no event-driven refresh.

See [Environment Variables](/docs/reference/env-vars) for the full variable reference.

## Behavior and security

Every configured request must carry a valid Shopify signature. Missing, malformed, or incorrect signatures return `401`. The handler rejects the request before using its topic or payload.

Product notifications refresh the affected product wherever it appears, including recommendations and sitemap content. Product creation and deletion also refresh catalog membership.

Collection notifications refresh the affected collection and collection listings by handle and by ID, so a deleted collection, or the old URL of a renamed one, renders the not-found page. Collection creation and deletion also refresh collection membership and sitemap content.

Metaobject notifications refresh metaobject-backed content only when your custom reads participate in the template's metaobject invalidation behavior. The base template does not read metaobjects by default.

## Refresh content without a webhook

Shopify sends no webhook when pages, blogs, articles, store policies, navigation menus, or Search & Discovery filters change. To show those edits right away, send a refresh request with a `tag` for each kind of content you changed.

1. Generate a secret with `openssl rand -base64 32` and set it as `REVALIDATE_SECRET` for that environment.
2. After publishing an edit, send the request with the secret as a Bearer token:

```bash
curl -X POST "https://your-domain.com/api/revalidate?tag=pages&tag=policies" \
  -H "Authorization: Bearer $REVALIDATE_SECRET"
```

| After editing                                                                     | Tags                   |
| --------------------------------------------------------------------------------- | ---------------------- |
| Pages                                                                             | `pages`                |
| Blogs or articles                                                                 | `blogs` and `articles` |
| Store policies                                                                    | `policies`             |
| Navigation menus, with [Shopify menus](/docs/skills/enable-shopify-menus) enabled | `menus`                |
| Search & Discovery filters                                                        | `products-index`       |

The response lists the refreshed tags, and the next visit loads fresh content from Shopify. Without `REVALIDATE_SECRET`, the endpoint returns `404`; a wrong token returns `401`. Send up to 20 tags per request.

## Limits

The included handler does not subscribe to inventory-level topics. Up to 250 variants, price and stock come from the cached product and can lag until it refreshes; Shopify sends `products/update` when a product is ordered, so that topic keeps availability current. Past 250 variants, selecting a variant reads Shopify, unless every variant is sold out: that product can show sold out after a restock until its cache refreshes.

This handler does not refresh Online Store pages, blogs, articles, or store policies; [send a refresh request](#refresh-content-without-a-webhook) after editing them. See [Content pages](/docs/anatomy/pages/content) for publishing guidance.

Navigation menu edits are also outside this handler.

Malformed product or collection update payloads cannot identify a specific resource, so they do not refresh the full catalog. Valid Shopify deliveries include the expected identifiers.

After registering a topic, use **Send test notification** in Shopify Admin and confirm the delivery succeeds before relying on it for storefront freshness.

## What’s next

Add a topic only when Shopify offers a webhook for the resource and the storefront has a safe way to refresh the affected data. Prefer targeted refreshes for frequently changing catalog data. Use broader refreshes only when an event cannot be scoped or after an intentional bulk change.

To keep content without a webhook current without a manual step, have a scheduler send the refresh request. Each run reloads that content from Shopify on the next visit, so choose a schedule that matches how often merchants edit it.

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)