Skip to content
Bazzario

Webhooks

Order, product and customer events, the Bazzario-Signature header and delivery retries.

A webhook is a POST request to your https URL when something changes. The owner adds URLs in Settings → API, or a secret key with the webhooks:write scope does (/v1/admin/webhook-endpoints).

EventWhen
order.createdAn order is created (site, dashboard, marketplace, Admin API)
order.status_changedFulfilment or payment status changed, or the order was cancelled or refunded
product.createdA product is created, including by import
product.updatedA product, its stock or availability changed
product.deletedA product is deleted; data is only { "id" }
customer.createdA customer is created
payment.succeededA payment on an order was confirmed by the provider or marked paid
payment.failedA payment attempt failed or expired
refund.createdA refund was started for an order
refund.completedA refund was paid out to the buyer
shipment.createdA waybill or shipment was created for an order
shipment.status_changedThe carrier reported a new shipment status; data.previousStatus holds the status before the change

Request body

data is the same object the Admin API returns (currency, money in minor units, shippingAddress.country, the external order fields, …). Payment, refund and shipment events carry the payment (invoiceId), refund (refundId) or shipment (shipmentId) object with its orderId.

json
{
  "id": "evt_01J…",
  "type": "order.created",
  "createdAt": "2026-11-22T09:15:00.000Z",
  "data": { "id": "…", "orderNumber": 10542, "currency": "PLN", "total": 25500 }
}

Headers: Bazzario-Signature, Bazzario-Event (event type), Bazzario-Delivery (delivery id).

Verifying the signature

The header looks like t=<unix time>,v1=<hex>. The signature is HMAC-SHA256 of <t>.<raw body>, keyed with the full endpoint secret including the whsec_ prefix. The secret is shown once at creation and can be rotated. Reject requests whose t differs from the current time by more than 5 minutes.

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

// rawBody — the request body as a string, before JSON parsing
export function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map(p => p.split('=')));
  const t = parts.t;
  const age = Math.abs(Date.now() / 1000 - Number(t));
  if (!t || !parts.v1 || age > 300) return false;
  const expected = createHmac('sha256', secret)
    .update(t + '.' + rawBody)
    .digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(parts.v1);
  return a.length === b.length && timingSafeEqual(a, b);
}
PHP
<?php
function verify(string $rawBody, string $header, string $secret): bool {
    $parts = [];
    foreach (explode(',', $header) as $p) {
        [$k, $v] = explode('=', $p, 2);
        $parts[$k] = $v;
    }
    if (!isset($parts['t'], $parts['v1']) || abs(time() - (int)$parts['t']) > 300) {
        return false;
    }
    $expected = hash_hmac('sha256', $parts['t'] . '.' . $rawBody, $secret);
    return hash_equals($expected, $parts['v1']);
}
Python
import hashlib, hmac, time

def verify(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    t, v1 = parts.get("t"), parts.get("v1")
    if not t or not v1 or abs(time.time() - int(t)) > 300:
        return False
    signed = t.encode() + b"." + raw_body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, v1)

Delivery and retries

  • Success is a 2xx response within 10 seconds. Redirects (3xx) count as failures.
  • Retries after 1 min, 5 min, 30 min, 2 h and 6 h (5 retries); then the delivery is marked permanently failed.
  • After 3 days without a successful delivery the endpoint is disabled and the owner is notified. Re-enable it in the dashboard after fixing the URL.
  • Delivery is at least once and unordered: de-duplicate by the event id and do not rely on sequence.
  • The event is sent after the change is saved, on a best-effort basis: if the server fails at that moment a webhook may not be created. Reconcile daily with updatedSince.
  • Respond fast with 2xx and process the event asynchronously.
  • The dashboard shows the last 50 deliveries with a “Send again” button; records are kept for 30 days.
Add an endpoint through the API
curl -X POST https://api.bazzario.app/v1/admin/webhook-endpoints \
  -H "Authorization: Bearer bzk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/hooks/bazzario", "events": ["order.created", "order.status_changed"] }'