Skip to main content

How does a Webhook work?

A webhook is an HTTP POST request sent by Restoo to an HTTPS endpoint you control. The request is triggered automatically whenever an event occurs. For additional information on Webhooks, there are a number of good resources:

Restoo Webhooks

Restoo Webhooks comply with the Standard Webhooks initiative. Your webhook handler must:
  • Be publicly accessible via HTTPS.
  • Return HTTP 200 OK to acknowledge the delivery.
  • Respond within 10 seconds.
  • Handle retries correctly (see Retry Policy).
To verify that incoming requests were genuinely sent by Restoo, follow the steps in Securing Webhooks. Each webhook includes a set of HTTP headers and a JSON payload.

Headers

The request will be sent with the following HTTP headers:
Example webhook headers

Payload

All webhook payloads share the same top-level structure:
Example webhook payload

Retry Policy

A webhook attempt is considered failed when your endpoint:
  • Returns a non‑2xx code.
  • Does not respond within 10 seconds.
  • Is unreachable.
Restoo retries delivery up to 5 times (6 total attempts) using the following backoff schedule: All retries carry the same Webhook-Id, Webhook-Timestamp, and Webhook-Signature headers as the original attempt. After all retries fail, the webhook is marked undeliverable.
Your integration may be disabled if the endpoint consistently fails.

Idempotency

Because of retries, your handler must be idempotent:
  • Use Webhook-Id to detect already-processed deliveries.
  • Skip duplicated attempts safely.

Securing Webhooks

Webhook Signing Secret

Each Partner is assigned a unique webhook signing secret used to verify the authenticity of all webhooks sent by Restoo.
  • A single signing secret is generated per Partner.
  • This secret is shared across all webhook deliveries associated with that Partner.
  • The same secret must be used to verify every incoming webhook request.
  • This secret must be kept confidential and never exposed in client-side code.
The signing secret is provided by Restoo in the following format:
You must use this secret to validate the Webhook-Signature header included in each webhook request.
Webhook-Signature format
Each environment (e.g. Dev and Prod) has its own signing secret. Make sure you are using the correct secret for the environment receiving the webhook.

How the signature is generated

Restoo generates a webhook signature following these steps:
  1. Remove the whsec_ prefix from your signing secret provided by Restoo.
  2. Base64-decode the signing secret.
  3. Build the signed content: <Webhook-Id>.<Webhook-Timestamp>.<raw_body>.
  4. Compute HMAC-SHA256 of the signed content with binary output.
  5. Base64-encode the output.
  6. Build the final signature by prefixing it with the version identifier (v1,).
Example of signature generation using PHP

Verification steps

To verify the authenticity, your webhook handler must:
  1. Read the raw request body . Must be the exact byte-for-byte body received (no parsing, no reformatting).
  2. Extract the following headers: Webhook-Id, Webhook-Timestamp, Webhook-Signature.
  3. Recompute the signature using HMAC-SHA256 with your Base64-decoded signing secret.
  4. Remove the v1, prefix from the header.
  5. Compare signatures using a constant-time comparison to prevent timing attacks.
Example of secure constant-time comparison using PHP
You may enforce a maximum timestamp age to reduce replay attacks. Make sure this window is compatible with Restoo retry delays.

Available Webhook Events

Each event includes a structured payload describing the resource affected. More events will be added over time. Unknown event types should be ignored safely.
Your own API calls also trigger booking.created and booking.updated. If you create or update a booking and then receive a webhook for it, that webhook was caused by your own request. Use Webhook-Id for idempotency but do not assume these events always originate externally.