WebhooksEvents
Open app

Events

Events are the audit log of significant state changes in a store — the same envelope Mercel POSTs to your subscribed webhook endpoints. Payloads are thin: every event carries {id, type, created, subject} where subject.url points at the resource. Follow the URL to retrieve the resource's current state.

The event object

The event object is the shape returned by endpoints in this collection. Its attributes are listed below.

Attributes

createdtimestamp

Time the event was emitted (ISO-8601).

idstring

Unique identifier for the event.

subjectobject
typestring

Event type, e.g. product.created. See the list of supported types in the Webhooks reference.

Example response
{  "created": "2026-01-01T00:00:00.000Z",  "id": "evt_01HJZQK7XJ8R9YGEWABCDEFGHJK",  "subject": {    "id": "prd_01HJZQK7XJ8R9YGEWABCDEFGHJK",    "type": "product",    "url": "/v1/products/prd_01HJZQK7XJ8R9YGEWABCDEFGHJK"  },  "type": "product.created"}

List all events

Lists events emitted in the store, newest first. Webhook payloads are thin — they carry only an identifier in subject — so listing events is the way to enumerate what has happened. Follow subject.url on each item to retrieve the underlying resource. Uses the standard list envelope — see Pagination.

Path & query parameters

limitinteger

Maximum number of items to return per page. Defaults to 20, capped at 100.

1 ≤ value ≤ 100
pagestring

Opaque pagination token. Pass the value returned in nextPageUrl / previousPageUrl rather than constructing one — the encoding is internal and may change.

typestring

Filter to a single event type (exact match).

subjectTypestring

Filter to events whose subject is of this type (e.g. product).

subjectIdstring

Filter to events about a single resource id. Pair with subjectType to scope safely.

curl -X GET "https://api.mercel.app/v1/events"
Response200
{
  "data": [
    {
      "created": "2019-08-24T14:15:22Z",
      "id": "evt_01HJZQK7XJ8R9YGEWABCDEFGHJK",
      "subject": {
        "id": "prd_01HJZQK7XJ8R9YGEWABCDEFGHJK",
        "type": "product",
        "url": "/v1/products/prd_01HJZQK7XJ8R9YGEWABCDEFGHJK"
      },
      "type": "product.created"
    }
  ],
  "nextPageUrl": "http://example.com",
  "previousPageUrl": "http://example.com"
}

Retrieve an event

Retrieves a single event by id. The response is byte-identical to the body POSTed to subscribed webhook endpoints for the same event — use this to re-fetch, debug, or replay a delivery without setting up a public endpoint.

Path & query parameters

eventIdstringRequired

The id of the event.

curl -X GET "https://api.mercel.app/v1/events/evt_01hh9zzzzzzzzzzzzzzzzzzzzz"
Response200
{
  "created": "2019-08-24T14:15:22Z",
  "id": "evt_01HJZQK7XJ8R9YGEWABCDEFGHJK",
  "subject": {
    "id": "prd_01HJZQK7XJ8R9YGEWABCDEFGHJK",
    "type": "product",
    "url": "/v1/products/prd_01HJZQK7XJ8R9YGEWABCDEFGHJK"
  },
  "type": "product.created"
}

On this page