Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Revalidate payload

JSON body Enad sends to the revalidate endpoint for each content item.

Each revalidate request contains a single JSON object. The type field is a discriminator (product, category, or collection); remaining fields depend on the content type.

All UUIDs are serialized as strings. Translation fields are arrays of { locale, value } objects converted from Enad’s locale maps.

Common types

Translation

Field Type Description
locale string Locale code (for example en, sv)
value string Translated string for that locale

Non-string values in the source locale map are serialized as an empty string.

Product

Sent when a product (or its channel content) changes.

{
  "type": "product",
  "id": "0195a1b2-c3d4-7890-abcd-ef1234567890",
  "name": "Base Product",
  "slug": "base-product",
  "sku": "SKU-1",
  "translations_name": [
    { "locale": "en", "value": "Base EN" },
    { "locale": "sv", "value": "Base SV" }
  ],
  "translations_slug": [
    { "locale": "en", "value": "base-en" },
    { "locale": "sv", "value": "base-sv" }
  ]
}
Field Type Description
type "product" Content discriminator
id string (UUID) Product ID
name string Display name (channel override when endpoint has a channel)
slug string URL slug (channel override when endpoint has a channel)
sku string Stock keeping unit (always from base product)
translations_name Translation[] Localized names
translations_slug Translation[] Localized slugs
changes string[] (optional) What changed for this product; see Changes

Channel override example

When the endpoint is tied to a channel and channel content exists:

{
  "type": "product",
  "id": "0195a1b2-c3d4-7890-abcd-ef1234567890",
  "name": "Channel Product",
  "slug": "channel-product",
  "sku": "SKU-1",
  "translations_name": [
    { "locale": "en", "value": "Channel Product EN" }
  ],
  "translations_slug": [
    { "locale": "en", "value": "channel-product-en" }
  ]
}

Category

Sent when a category changes.

{
  "type": "category",
  "id": "0195a1b2-c3d4-7890-abcd-ef1234567890",
  "name": "Base Category",
  "slug": "base-category",
  "uri": "/base-category",
  "translations_name": [
    { "locale": "en", "value": "Category EN" }
  ],
  "translations_slug": [
    { "locale": "en", "value": "category-en" }
  ],
  "translations_uri": [
    { "locale": "en", "value": "/category-en" }
  ]
}
Field Type Description
type "category" Content discriminator
id string (UUID) Category ID
name string Display name
slug string URL slug
uri string Canonical path or URI
translations_name Translation[] Localized names
translations_slug Translation[] Localized slugs
translations_uri Translation[] Localized URIs
changes string[] (optional) What changed for this category; see Changes

Collection

Sent when a collection changes.

{
  "type": "collection",
  "id": "0195a1b2-c3d4-7890-abcd-ef1234567890",
  "name": "Base Collection",
  "slug": "base-collection",
  "uri": "/base-collection",
  "translations_name": [
    { "locale": "en", "value": "Collection EN" }
  ],
  "translations_slug": [
    { "locale": "en", "value": "collection-en" }
  ],
  "translations_uri": [
    { "locale": "en", "value": "/collection-en" }
  ]
}
Field Type Description
type "collection" Content discriminator
id string (UUID) Collection ID
name string Display name
slug string URL slug
uri string Canonical path or URI
translations_name Translation[] Localized names
translations_slug Translation[] Localized slugs
translations_uri Translation[] Localized URIs
changes string[] (optional) What changed for this collection; see Changes

Changes

Every payload type — product, category, and collection, including deletions — carries an optional changes array listing what changed for that item. Use it to invalidate only the pages whose data actually changed instead of treating every event as a full invalidation.

{
  "type": "product",
  "id": "01953c1a-2f3e-7f10-a1b2-c3d4e5f60718",
  "name": "Sorling",
  "slug": "sorling",
  "sku": "SKU-1",
  "changes": ["translations_name.sv", "translations_slug.sv"],
  "translations_name": [{ "locale": "sv", "value": "Sorling" }],
  "translations_slug": [{ "locale": "sv", "value": "sorling" }]
}

Tokens

Tokens are payload field names where the payload has one: name, slug, sku, and uri.

Translation tokens are per field and per locale, joined with a dot: translations_name.sv, translations_slug.fi, translations_name.en-gb. There is one token per locale per field, so updating the Swedish and Finnish name translations queues ["translations_name.fi", "translations_name.sv"].

Events that carry no locale information emit the plain tokens translations_name and translations_slug, meaning all locales. Only translations_delete events do this, since they carry translation IDs but no locale.

Changes that don’t map to a payload field use semantic tokens: prices, stock, images, videos, files, tags, attributes, variant_groups, categories, collections, products.

Stock changes always include stock. Enad also queues out_of_stock when a product’s stock reaches 0 and back_in_stock when stock goes from 0 to above 0, so a transition queues both tokens. These are change tokens in the payload, not new Pub/Sub event types. Other stock changes only queue stock.

Previous stock is derived from inventory events already seen, so the first stock event after this change is deployed has no known previous value and does not emit back_in_stock.

Deletions send ["deleted"]. Manual revalidations triggered from Enad’s internal tooling send ["all"].

Accumulation

The list accumulates every change since the last delivery. If the same field changes several times before the event is sent, it appears once; distinct fields queue up together. After the event is sent, the list is cleared, so each event only carries changes the storefront has not seen yet.

Missing changes

The field is omitted when nothing is known — for example content queued before this change deployed. Treat a payload without changes as a full invalidation.

Batch delivery

When multiple items are pending for the same endpoint, Enad sends one HTTP request per item, not a batch array. Requests may arrive concurrently. The endpoint should be idempotent per type + id.