Skip to main content

Webhooks

A webhook is a message that Webround sends to your server the moment something happens in your store: a new order, a payment, a customer who registers, a return request. Your systems do not have to ask the API again and again.

With them you can send an order to the warehouse as soon as it is paid, send your own email or Slack message, or keep a database of your own in step with the store.

Set one up​

In the Webround Commerce dashboard, open your store and choose Webhooks in the side menu. Add the address (URL) of your endpoint and choose which events it listens to: each webhook has its own list.

Webround shows you a signing secret, only once. Keep it: you need it to check that a message comes from Webround. It is stored encrypted and decrypted only inside the process that signs the message, and it is never logged.

What you receive​

A POST with a JSON body and these headers:

HeaderWhat it is
X-Webhook-IdThe ID of the event, the same on every attempt to deliver it.
X-Webhook-EventThe event, such as order.paid.
X-Webhook-TimestampWhen it was sent, in milliseconds since the Unix epoch.
X-Webhook-SignatureThe signature, in hexadecimal.
X-Webhook-VersionThe version of the format (now 2026-01).
Idempotency-KeyThe same as X-Webhook-Id: use it to ignore an event you already handled.

The envelope​

Every body has the same shape. data is a snapshot of the entity and of its relations at the moment of the event, and it depends on the event: see the pages of each entity.

FieldTypeDescription
envelopeIduuidThe ID of the envelope.
eventTypestringThe event (order.created, order.paid…).
initiatedByemail, nullWho caused it: a user's email, or nothing when the system did.
storeIduuidThe store.
occurredAtdatetimeWhen it happened (ISO 8601).
dataobjectThe snapshot.

Check the signature​

The signature is an HMAC-SHA256, in hexadecimal, calculated with your secret over the timestamp, a dot and the raw body, exactly as it arrived:

HMAC-SHA256(secret, "{X-Webhook-Timestamp}.{raw body}")

Check it, compare it in constant time, and refuse messages with an old timestamp: that stops anyone who intercepts a message from sending it again.

import { createHmac, timingSafeEqual } from 'node:crypto';

export function isFromWebround(rawBody, headers, secret) {
const timestamp = headers['x-webhook-timestamp'];
if (Math.abs(Date.now() - Number(timestamp)) > 5 * 60 * 1000) return false; // older than 5 minutes
const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const received = String(headers['x-webhook-signature']);
return expected.length === received.length && timingSafeEqual(Buffer.from(expected), Buffer.from(received));
}

Use the body as a string, before parsing it: a parsed and re-written JSON is not the same text.

Delivery and retries​

Answer with any 2xx within 30 seconds. Anything else, or no answer, is a failure, and Webround tries again after 30 seconds, 2 minutes, 5 minutes, 15 minutes, 1 hour, 6 hours and 24 hours. After the last one the message is marked as failed.

An event can arrive more than once, so make your handler safe to repeat: use Idempotency-Key to recognize one you already handled.

Replay and audit

In the Events section of the Webhooks page of the dashboard you see every message. Click one and choose Send again to receive it once more.

Events​

EntityEvents
OrdersCreated, updated, canceled, paid, payment failed, refunds and disputes, and the order items.
ProductsCreated, updated, deleted, and each list linked to them replaced.
VariantsThe same, with prices and stock.
CustomersRegistrations, profile, addresses, newsletter, and the emails that concern them.
Return requestsCreated, updated, deleted, and a guest asking for the link.
SubscriptionsThe whole life of a recurring subscription.
Know what happens at your endpoint

Webround does not send sensitive credentials, but it does send signed payloads and customer data, for example when a customer asks to delete their account or saves a new shipping address. Webround only forwards the data you chose. Once it leaves the platform, its integrity and the compliance with privacy rules are your responsibility.