---
title: Webhooks
description: Refresh supported storefront content when Shopify products, collections, or metaobjects change.
url: "https://shop-docs.labs.vercel.dev/docs/anatomy/webhooks"
docs_index: /llms.txt
lastUpdated: 2026-10-13
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. 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.

## Limits

The included handler does not refresh inventory-level changes. Stock shown for the default variant can lag until the product cache refreshes; selecting a variant reads its current availability from Shopify.

This handler does not refresh Online Store pages, blogs, articles, or store policies. Those edits appear when cached content refreshes unless you arrange a separate refresh. 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.

---

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)