Start free

Help center / Developers and AI agents

Webhooks

Receive signed HTTP notifications when orders are placed or paid and when forms are submitted.

A webhook sends your server a JSON POST when something happens on your site. Use it to feed a CRM, a fulfilment system or an automation tool.

Set one up

  1. In the Studio, open Connections and find Event connectors.
  2. Add a Webhook and enter your POST URL, with an optional Signing secret. If you leave it empty, one is generated for you.
  3. Send a test before relying on it.

Webhook connectors cover order.placed, order.paid and form.submitted. The body contains event, site, at (milliseconds) and data.

Headers

HeaderMeaning
x-xigzag-eventEvent name
x-xigzag-siteSite id
x-xigzag-delivery-id and idempotency-keyStays the same across retries
x-xigzag-timestampUnix time in seconds
x-xigzag-signaturesha256= followed by the HMAC

Verify the signature

Compute HMAC-SHA256 over the timestamp, a dot and the raw body, using your signing secret. Reject deliveries more than 300 seconds old.

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

export function verify(secret, rawBody, headers) {
  const t = headers["x-xigzag-timestamp"];
  if (!(Math.abs(Date.now() / 1000 - Number(t)) <= 300)) return false;
  const want = Buffer.from("sha256=" + createHmac("sha256", secret).update(t + "." + rawBody).digest("hex"));
  const got = Buffer.from(headers["x-xigzag-signature"] || "");
  return want.length === got.length && timingSafeEqual(want, got);
}

Good practice

  • Verify against the raw request body, before parsing it.
  • Store delivery ids and ignore ones you have already handled.
  • Give the final URL. Redirects are not followed.
  • Respond quickly with a success status and do slow work afterwards.

Related articles

Still need help?
Open a support ticket or write to hello@xigzag.com.