Developers

How POS events reach the guest record

A short engineering note on the POS webhook route, how requests are verified and routed to the owning cell, and how repeats are handled.

Scope of this note

This note describes the contract that exists today for an external POS posting orders to Active Reach. It covers the route, verification, routing to the right region cell and the behaviour of the handler on repeats. It does not describe vendor field mappings, which depend on the POS and should be confirmed with your Active Reach contact.

The webhook route

An external POS posts to the gateway, never directly to a cell. The route has this shape:

  • URL: /api/v1/webhooks/pos/{org_id}/{workspace_id}/{provider}
  • Method: POST with the vendor's own JSON body.
  • org_id: your brand's organisation identifier.
  • workspace_id: the workspace for the brand.
  • provider: the POS name in lower case. An unknown provider returns 404.

A URL with fewer than three path parts after the prefix also returns 404.

Verifying the request

The gateway checks an HMAC of the raw request body. The secret is held per tenant, and the digest is SHA-256 in hex. The header that carries the signature depends on the provider: x-webhook-signature for Petpooja and Posify, x-posist-signature for Posist, with separate headers for Lightspeed and Square.

A request with a missing or wrong signature is rejected with an error code and does not reach any cell. Compute the signature over the exact bytes you send, so do not re-serialise the JSON after signing.

Routing to the owning cell

The gateway looks up which cell owns the tenant and forwards the request there. The receiving cell does not decide ownership for itself, which keeps a request for one brand from being processed in another brand's region.

The gateway marks the forwarded request as already validated and records the tenant and provider. If a request ever reaches the wrong cell, that cell answers 421 as a safeguard.

What the handler does with an order

The cell's POS handler resolves the outlet for the order, then performs these steps:

  • Logs the webhook for traceability.
  • Creates or updates the guest's contact from the order.
  • Records the order on the contact and into the revenue ledger.
  • Adds a kitchen display order where the outlet uses that feature.
  • Emits events that journeys and loyalty read.

A cancelled order comes off the contact again. The exact fields read from each vendor's payload need confirmation per POS.

Repeats and retries

Every step is designed to be safe on a re-send. The contact update and the revenue ledger key on the order, and an echo check prevents an order that Active Reach itself pushed to a POS from being counted a second time when the POS reports it back.

If the handler fails it answers with a server error and the provider is expected to retry. Retries therefore produce the same end state, not duplicate orders.

Sending your own events

Brand systems that are not a supported POS can send events to the event ingestion service. The ingestion routes accept a single event, a message event and a batch.

  • An event carries a tenant identifier, an external event identifier and a timestamp, with a free-form payload.
  • An optional dedupe key lets the service recognise a repeat.
  • A batch reply counts processed events, duplicates and errors, and lists any index a concurrent copy is still holding so the sender can re-send those.

Authentication for this route should be confirmed before you build against it.

Operating notes

  • Secrets. Keep the webhook secret on the POS side only, and rotate it with your Active Reach contact.
  • Ordering. Do not rely on events arriving in order. An update may arrive before the create after a retry, so send the full order each time.
  • Outlets. The handler resolves the outlet for each order, so make sure the outlet identifier in the POS matches the outlet set up in the workspace.
  • Phone numbers. A guest record needs a usable number. Orders without one are still recorded, but cannot be linked to a person until a number appears later.
  • Logs. Each webhook is logged, which is the first place to look when an order does not appear.

Things this note does not promise

This note does not state a response time, a throughput limit or an uptime commitment, because none is documented in the repo. It does not describe two-way inventory sync or kitchen order state changes sent back to a POS.

If you need any of those for your integration, raise it with your Active Reach contact so it can be confirmed and written down.

What to test before go-live

  1. Send a signed test order and confirm it appears on a guest record.
  2. Send the same order twice and confirm there is one order.
  3. Send a cancellation and confirm the order is removed from the contact.
  4. Send a request with a bad signature and confirm it is refused.

See your own guests in it

A 30-minute walkthrough on your POS, your channels and your outlets.