novinzodevelopers
Store webhooks

Store webhooks

Receive a store's events and deliver products from your own server, with signed HTTPS requests.

A store can call your server in two ways. Both send signed JSON with POST. Event webhooks are set up in the dashboard under Settings → Developers; a product delivery webhook is set in a variant's What the buyer gets, under Deliver from your own server.

WebhookWhat it doesYour answer
Event webhooksTells your server that an order was paid or completed, or a checkout ended.Any 2xx. Novinzo ignores the body.
Product delivery webhooksAsks your server for what to give the buyer for each paid order line.200 with the deliverables, one per line.

These webhooks need no plugin. A plugin Worker receives a different set of events, described in plugin webhooks.

Signatures

Every request carries a Novinzo-Signature header:

Novinzo-Signature: t=1790000000,v1=<64 lowercase hex characters>

t is the Unix time of the request in seconds. v1 is the lowercase hex HMAC-SHA256 of the timestamp, a dot, and the raw request body, keyed with the whole signing secret (whsec_…) as UTF-8.

Each event endpoint has its own secret. Product delivery webhooks share one secret per store. A rotated secret replaces the old one at once, so update your server before you rotate.

Verify a request before you act on it:

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

const TOLERANCE_SECONDS = 5 * 60;

/** True when `header` signs `rawBody` with `secret` within the last five minutes. */
export function verifySignature(secret: string, header: string, rawBody: string): boolean {
  const parts = Object.fromEntries(header.split(",").map((part) => part.split("=", 2)));
  const timestamp = Number(parts.t);
  if (!Number.isInteger(timestamp) || typeof parts.v1 !== "string") {
    return false;
  }
  if (Math.abs(Date.now() / 1000 - timestamp) > TOLERANCE_SECONDS) {
    return false;
  }
  const expected = createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest();
  const received = Buffer.from(parts.v1, "hex");
  return received.length === expected.length && timingSafeEqual(received, expected);
}

Sign the body exactly as received. Parsing and re-serializing the JSON changes the bytes and breaks the signature.

The timestamp check refuses a captured request replayed later. Keep your server's clock synchronized.

Endpoint URLs

Novinzo only calls public HTTPS URLs:

  • The scheme is https, and the URL holds no user name or password.
  • The host is a domain name with a dot, not an IP address, localhost, or a .local, .internal, .lan or .home.arpa name.
  • The URL is at most 2,048 characters.

Novinzo does not follow redirects. Give the final URL.

Address checks for event webhooks

An event webhook endpoint is also checked where its host name points, when you save it and again before every delivery:

WhenCheck
Saving or changing the URLThe host must not be Novinzo's own domain, including any store's Novinzo subdomain. It must also resolve, and every A and AAAA address it resolves to must be public. Otherwise the save is refused.
Before each delivery attemptThe host is resolved again. A private, loopback or other non-public address ends the delivery without a request, and it is not retried.
Before each delivery attemptA host that does not resolve, or that could not be looked up, counts as a failed attempt and is retried like any other.

A refused save names its reason:

ReasonMessage
own_domainNovinzo's own addresses cannot receive webhooks.
non_public_addressThe URL's host resolves to a private or reserved IP address. Use a host on the public internet.
unresolvableThe URL's host name does not resolve to an IP address. Check the host name.
lookup_failedThe URL's host name could not be looked up right now. Try again in a moment.

A product delivery webhook URL is checked without a DNS lookup when you save it: by its text, and it must not be on Novinzo's own domain. Its host is resolved before every delivery attempt, with the same outcomes as an event webhook's. A test request is not sent to a host that is non-public, does not resolve, or could not be looked up.

On this page