emfasemfas
Webhooks

Webhooks

Get notified in real time when products, variants, SKUs and other catalog entities change in Emfas.

Webhooks let your systems react to catalog changes the moment they happen, instead of polling the REST API. When an entity is created, updated, or deleted, Emfas sends a signed POST request to the endpoints you've configured.

How it works

  1. You register one or more endpoints — public https URLs that receive events.
  2. Each endpoint subscribes to a set of topics, e.g. product.updated or variant.deleted.
  3. When a matching change happens, Emfas delivers a small, signed JSON payload to your endpoint.
  4. The payload tells you what changed and the identifier of the affected entity — you fetch the full, current record from the REST API.

Payloads are intentionally minimal — they carry the event and the entity's identifier, not the full entity. This keeps deliveries fast and avoids stale data: you always re-fetch the latest state. See Payload.

Creating a webhook

  1. Open Settings → Emfas API → Webhooks.
  2. Click + and enter your endpoint URL (must be https).
  3. Choose the events you want to receive.
  4. Click Create webhook and copy the signing secret — it's shown only once. You'll use it to verify signatures.

What you should build

A robust webhook consumer should:

  • Verify the signature on every request (see Signature verification).
  • Respond quickly with a 2xx status. Do heavy work asynchronously — Emfas treats any non-2xx (or a timeout) as a failed delivery and retries.
  • Be idempotent. A delivery may arrive more than once; use the entity identifier to deduplicate.
  • Re-fetch current state via the REST API rather than trusting the order of events.

Your endpoint must be reachable over public https. Localhost and private/internal addresses are rejected when you create a webhook.