Skip to main content
Yonne delivers real-time order status updates to your server via webhooks. Every payload is signed with HMAC-SHA256 — you must verify the signature on every request to ensure the payload came from Yonne and hasn’t been tampered with.

Overview

Rather than polling the Yonne API for order status changes, webhooks let Yonne push updates to your server the moment something happens. This enables:
  • Real-time order tracking — update your OMS as soon as a driver is assigned or an order is delivered.
  • Automated customer notifications — send SMS or email confirmations without polling.
  • Fulfilment automation — trigger warehouse or logistics workflows the instant an order changes state.

Setting up your endpoint

1. Configure your webhook URL and secret

In your Yonne merchant dashboard, navigate to Settings → Webhooks and fill in two fields:
No webhook_url, no webhooks. If this field is not set for your merchant account, Yonne will not send any webhook notifications for your orders.

2. Expose your endpoint

Your endpoint must be reachable from the public internet. During development, use a tunnelling tool to expose your local server:

3. Respond with 200 OK within 10 seconds

Yonne considers any response outside the 10-second window as a failure and will schedule a retry. Return 200 as fast as possible and process the event asynchronously (see Best Practices).

The webhook payload

Every event uses the same envelope structure:

Key fields


The signature header

Yonne signs every webhook request and includes the signature in the X-Yonne-Signature header:
The value is the HMAC-SHA256 hex digest of the raw request body, computed using your webhook_secret as the key.

Verifying the signature

Always verify the signature before processing the payload. Reject any request where the signature does not match.
Critical: read raw bytes first. Compute the HMAC over the exact raw bytes Yonne sent. If you parse the JSON body first and then re-serialize it, the byte sequence will differ and the signature will never match — even for legitimate requests.
Use constant-time comparison. Always use timingSafeEqual (Node.js) or hmac.compare_digest (Python) / hash_equals (PHP) when comparing signatures. A regular string equality check is vulnerable to timing attacks.

Best practices

Fast ACKs — respond immediately, process asynchronously

Your endpoint must return any 2xx status code within 10 seconds. Yonne does not use the response body. If your processing logic (database writes, sending notifications, calling third-party APIs) might take longer, acknowledge first and do the work in a background job:

Idempotency — handle duplicates gracefully

The same event can be delivered more than once (e.g. if your server returned 200 but the network dropped before Yonne received the response). Use the combination of order_id + event as a deduplication key:

Delivery guarantees & retries

Yonne guarantees at-least-once delivery. If your endpoint is unavailable or returns a non-2xx status, Yonne will retry with exponential backoff:

Testing your handler in development

Use the simulate-status endpoint with your test API key to trigger webhook deliveries without waiting for a real rider: