Lueira — Management software for active tourism

Webhooks

Webhooks let you receive real-time notifications when events happen on your account, instead of polling the API.

Setup

Create a webhook endpoint from Settings → Developers → Webhooks, providing the destination URL (must use HTTPS) and the events you want to subscribe to. Creating it generates a signing secret that's only shown once.

Headers on every delivery

HeaderContent
X-Lueira-Webhook-EventEvent name, e.g. order.created
X-Lueira-Webhook-IdDelivery UUID — use it as an idempotency key
X-Lueira-Webhook-TimestampSend time, in ISO 8601
X-Lueira-Webhook-Signaturesha256=<hex> — HMAC-SHA256 of the request
X-Lueira-Webhook-Tenant-IdOriginating tenant
X-Lueira-Webhook-Versionv1

Verifying the signature

The signature is an HMAC-SHA256 computed over the string {timestamp}.{raw body}, using your webhook secret as the key. Recompute it and compare against X-Lueira-Webhook-Signature before processing the event; reject any delivery whose timestamp is older than 5 minutes to guard against replay attacks.

Node.js
const crypto = require("crypto");

function isValidSignature(secret, timestamp, rawBody, signatureHeader) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");
  return signatureHeader === `sha256=${expected}`;
}

Retries and endpoint health

If your endpoint doesn't respond with a 2xx status, the delivery is retried up to 6 times with exponential backoff (roughly 1 min, 5 min, 30 min, 2 h, 6 h, 12 h). After 20 consecutive failures the endpoint is automatically disabled and you'll get an email notice; you can re-enable it, redeliver individual events, or send a test event from the panel.

Event catalogue

EventDescription
order.createdA new order or booking has been created.
order.updatedChanges to an existing order.
order.cancelledThe order has been cancelled.
order.completedThe order has been completed.
customer.createdA new customer has been registered.
customer.updatedChanges to customer data.
payment.capturedA payment has been captured.
payment.refundedA payment has been refunded (full or partial).
product.createdA product has been added to the catalogue.
product.updatedChanges to the catalogue (prices, stock, etc.).
voucher.redeemedA gift voucher has been redeemed.
invoice.issuedAn invoice has been issued.