# Webhook events

> Every event a site sends to its webhook endpoints, the payload of each, the headers, how to check the signature, retries and replays.

A site sends a signed `POST` to each of its webhook endpoints when something happens. Endpoints are set up in
**Settings › Developers › Webhooks** (the **Webhooks** Gear in the Gear Shop opens the same page): a web address, the events it
wants (or all of them), and on or off. A site can have up to 10 endpoints.

## The request

```json title="Body"
{
  "id": "evt_3f9a0c1d2b4e4f5a8b7c6d5e4f3a2b1c",
  "type": "order.paid",
  "site": "harbor-coffee",
  "createdAt": "2026-11-21T09:15:40.512Z",
  "data": { "id": "1042", "number": 1042, "paymentStatus": "paid", "total": 29, "currency": "USD", "customer": { "name": "Mia Wong", "email": "mia@example.com", "phone": "" } }
}
```

- `id` is the event's id. It stays the same on every retry and replay, so use it to skip events you've already handled.
- `type` is the event name below (`event` carries the same value, for older receivers).
- `data` is the record in the same shape the [REST API](/developers/rest-api) returns, plus a few extras for some events.

| Header | Value |
| --- | --- |
| `X-Vorjo-Event` | The event name, like `order.paid` (`test` for a test event) |
| `X-Vorjo-Event-Id` | The event's id, the same as `id` in the body |
| `X-Vorjo-Delivery` | This delivery's id: the same on its retries, new for a replay |
| `X-Vorjo-Timestamp` | Unix seconds when this try was signed |
| `X-Vorjo-Signature` | `v1=` and the hex HMAC-SHA256 of `"<timestamp>.<raw body>"` with the endpoint's signing secret |
| `X-Vorjo-Site` | The site's ID |

Answer with any `2xx` within 10 seconds. Addresses must be `https://` on a public host.

## Checking the signature

Each endpoint has its own signing secret (`whsec_…`), revealed and rotated on its row in **Settings › Developers**. Check the
signature on the raw body, before parsing it, and refuse timestamps more than 5 minutes old.

```js title="Node.js" group="Verify a webhook"
import crypto from "node:crypto";
export const verify = (rawBody, headers, secret) => {
  const ts = headers["x-vorjo-timestamp"], got = String(headers["x-vorjo-signature"] || "");
  const want = "v1=" + crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
  return got.length === want.length && crypto.timingSafeEqual(Buffer.from(got), Buffer.from(want)) && Math.abs(Date.now() / 1000 - Number(ts)) < 300;
};
```

```python title="Python"
import hmac, hashlib, time
def verify(raw_body: bytes, headers, secret: str) -> bool:
    ts = headers["X-Vorjo-Timestamp"]
    want = "v1=" + hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(want, headers.get("X-Vorjo-Signature", "")) and abs(time.time() - int(ts)) < 300
```

After **Rotate**, the old secret stops working at once, retries included.

## Retries, the log and replays

A delivery that doesn't get a `2xx` is tried again after about 30 seconds, 5 minutes, 30 minutes, 2 hours and 6 hours (six
tries in all). Addresses on a private network are blocked and not retried.

The **Logs** tab in Settings › Developers lists the last 30 days: the event, the endpoint, the status (delivered, retrying,
failed or blocked), your address's response code and the first 500 characters of its answer, the number of tries, and the
request body. **Replay** sends a delivery again now, with the same body and event id and a new delivery id. **Send test event**
sends a `test` event (`data: { message }`) to one endpoint, once.

## Events

| Event | When | `data` |
| --- | --- | --- |
| `order.created` | A new order was placed (paid or not yet) | Order (with `source`: first and last visit, see [the REST API](/developers/rest-api)) |
| `order.paid` | An order's payment was confirmed, or it was marked paid | Order |
| `order.fulfilled` | Items were sent or are ready for pickup | Order, plus `fulfillment: { id, lines, carrier, trackingNumber, trackingUrl, status, createdAt }` |
| `order.refunded` | Money was refunded (part or all) | Order, plus `refund: { amount, reason }` |
| `order.cancelled` | An order was cancelled | Order |
| `customer.signed_up` | A shopper created a customer account | `{ id, email, name, phone, marketing, createdAt }` |
| `contact.created` | A new contact card was made: from an order, booking, form, chat or email, or by hand | Contact |
| `booking.confirmed` | A booking was confirmed (paid, or nothing to pay) | Booking |
| `booking.created` | The same moment as `booking.confirmed`, under the name Gears use (pick one of the two) | Booking |
| `booking.moved` | A booking was moved to a new time | Booking, plus `previous: { startsAt, endsAt, staff }` |
| `booking.cancelled` | A booking was cancelled, by the customer or the business | Booking |
| `invoice.sent` | An invoice was sent | Invoice |
| `invoice.paid` | An invoice was paid in full | Invoice |
| `quote.accepted` | A quote was accepted | Invoice (the quote), plus `invoiceId`: the invoice made from it |
| `review.posted` | A customer wrote a product review | `{ id, productId, productHandle, productTitle, rating, title, body, name, email, verified, status, createdAt }` |
| `chat.lead` | A visitor left their email in the website chat | `{ id, name, email, question, page, createdAt }` |
| `lead.tapped` | A visitor tapped the site's Call, WhatsApp or Email link (at most 60 an hour per site) | `{ id, kind /* call \| whatsapp \| email */, page, createdAt }`: never who it was |
| `form.submitted` | A form was sent (not spam) | Form entry |
| `subscriber.added` | Someone joined the newsletter (after confirming, with double opt-in) | Subscriber |
| `subscriber.removed` | Someone unsubscribed | Subscriber |
| `inventory.low` | A product's stock dropped to your low-stock level (after an order, a Gear's stock change or a count) | `{ variantId, productId, product, variant, sku, inventory, threshold }` |

### Topics for Gears

[Hosted Gears and private Gears](/developers/gears-hosted#webhooks) subscribe in their manifest, not in Settings › Developers.
Their requests carry `X-Vorjo-Event`, `X-Vorjo-Delivery`, `X-Vorjo-Timestamp` and `X-Vorjo-Signature` (`v1=` + HMAC-SHA256 of
`"<timestamp>.<raw body>"` with the Gear's signing secret) and the body `{ id, event, createdAt, gear, shop, data }`. Besides
the order and product events, Gears get:

| Topic | Needs | When | `data` |
| --- | --- | --- | --- |
| `order.paid` | `read_orders` | An order's payment was confirmed, or it was marked paid | Order |
| `order.cancelled` | `read_orders` | An order was cancelled | Order |
| `booking.created` | `read_bookings` | A booking was confirmed (on the site, by the owner, or through the API) | Booking |
| `booking.cancelled` | `read_bookings` | A booking was cancelled | Booking |
| `inventory.low` | `read_inventory` | A variant's stock dropped to the site's alert level (after an order or an adjust) | `{ variantId, productId, product, variant, sku, inventory, threshold }` |
| `app.uninstalled` | | The Gear was removed from the site | `{ installId }` |

They're retried after about 1, 5 and 30 minutes, 2 and 6 hours, logged (last 100, 30 days) and can be sent again from the
Gear's **Webhooks** tab in the Developer dashboard.

Previews (test orders, bookings and messages) send nothing. `contact.created` isn't sent for CSV imports or for contacts
copied in the first time Contacts was opened.

### Shapes

```ts
Order = {
  id, number, name /* "#1042" */, status /* open | archived | cancelled */, paymentStatus /* pending | paid | partially_refunded | refunded */,
  fulfillmentStatus /* unfulfilled | partial | fulfilled | delivered */, currency, subtotal, discountTotal, shippingTotal, taxTotal, total, refunded,
  discountCode, payment: { method, label }, customer: { name, email, phone }, shippingAddress, billingAddress,
  shippingMethod: { kind, name, price } | null, note, tags: string[],
  lines: { id, productId, variantId, title, variantTitle, sku, qty, price, total, fulfilled }[],
  fulfillments: { id, lines, carrier, trackingNumber, trackingUrl, status, createdAt, deliveredAt }[],
  createdAt, updatedAt,
}
Booking = {
  id, serviceId, service /* its name */, staffId, staff, startsAt, endsAt, status /* confirmed | held | cancelled | done | no-show */,
  customer: { name, email, phone, note }, currency, price, paid, refunded, payStatus, createdAt, updatedAt,
}
Contact = { id, name, email, phone, company, address, tags: string[], notes, source, firstSeenAt, lastSeenAt, createdAt, updatedAt }
Invoice = {
  id, kind /* invoice | quote */, number /* "INV-0001" */, status /* draft | open | paid | void | sent | accepted | declined */, customer, contactId,
  currency, lines: { title, description, qty, price, taxName, taxRate, amount }[], subtotal, discountTotal, taxTotal, total, paid, balance,
  issueDate, dueDate, validUntil, sentAt, paidAt, acceptedAt, createdAt, updatedAt,
}
FormEntry = { id, form /* "contact" */, data: { [field]: string }, page, status /* new | read | done */, createdAt, updatedAt }
Subscriber = { id, email, name, status /* subscribed | pending | unsubscribed */, consentAt, confirmedAt, unsubscribedAt, country, page, via, tags: ["Newsletter"], createdAt, updatedAt }
Product = { id, handle, title, description, status /* active | draft | archived */, type, vendor, tags, images, options, collectionIds,
  variants: { id, title, options, sku, barcode, price, compareAtPrice, trackInventory, inventory, allowBackorder }[], createdAt, updatedAt }
```

New fields may be added to these shapes; existing ones keep their names and meaning.

See [n8n, Zapier and Make](/developers/automation) to use these events without writing code.
