> ## Documentation Index
> Fetch the complete documentation index at: https://platform.lulacommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive signed events as things happen.

Webhooks push events to your systems as they happen, so you never have to poll. Register an HTTPS endpoint, choose the events you want, and optionally limit the endpoint to specific stores.

```bash theme={null}
curl -X POST https://api.lulacommerce.com/v1/webhooks \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/lula",
    "events": ["order.created", "order.updated", "order.cancelled"],
    "description": "Kitchen system"
  }'
```

The response includes a signing `secret` (starting `whsec_`). It is shown once; store it securely.

## Events

| Event | Sent when |
| - | - |
| `order.created` | A new order is placed on any channel |
| `order.updated` | An order changes status, is adjusted, or its courier status changes |
| `order.cancelled` | An order is cancelled by the customer, channel, or store |
| `item.availability_changed` | An item's availability changes at a store on a channel |
| `store.status_changed` | A store is paused, resumed, opened, or closed on a channel |
| `channel.sync_completed` | A menu or inventory sync to a channel finishes |
| `recall.created` / `recall.lifted` | A recall starts or ends |
| `job.completed` | A batch job finishes |
| `export.completed` | An export file is ready |
| `payout.created` | A channel payout is received and reconciled |
| `menu.published` | A menu finishes publishing to a channel at a store |
| `promotion.status_changed` | A promotion goes live, ends, or cannot run on a channel |
| `order.delivery_failed` | An order could not be delivered to your order API after retries |
| `store.throttle_changed` | Kitchen capacity throttling starts or ends at a store |

Full payload schemas are in the [API reference](https://platform.lulacommerce.com/api-reference/orders/list-orders.md).

## Payload

Every event uses the same envelope:

```json theme={null}
{
  "id": "evt_01J9ZZ5Y8A2B",
  "type": "order.created",
  "created_at": "2027-03-01T02:14:09Z",
  "api_version": "1.0",
  "store_id": "8f1c2e4a-5b6d-4e7f-9a0b-1c2d3e4f5a6b",
  "data": { "id": "ord_01J9ZR8M3T5X", "status": "placed", "...": "..." }
}
```

## Verifying signatures

Each request carries a `Lula-Signature` header:

```
Lula-Signature: t=1772331249,v1=5f0c3b0e9a...
```

Compute an HMAC-SHA256 of `{t}.{raw request body}` using your endpoint secret and compare it to `v1` with a constant-time comparison. Reject requests where `t` is more than five minutes old.

```python theme={null}
import hmac, hashlib, time

def verify(secret: str, header: str, body: bytes) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    if abs(time.time() - int(parts["t"])) > 300:
        return False
    signed = f'{parts["t"]}.'.encode() + body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts["v1"])
```

## Delivery and retries

* Respond with any `2xx` within 10 seconds. Do the work asynchronously if it takes longer.
* Failed deliveries are retried with exponential backoff for up to 24 hours.
* Events can arrive more than once and out of order. Use `id` to de-duplicate and `created_at` or the resource's `updated_at` to order them.
* An endpoint that keeps failing for 72 hours is disabled and your account contacts are notified. Re-enable it with `PATCH /webhooks/{endpoint_id}`.
* Use `POST /webhooks/{endpoint_id}/test` to send a signed sample of any event.

## Event history and replay

Every event from the last 30 days is available with `GET /events`, filtered by type, store, and time. Use it to reconcile your systems against Lula or to catch up after downtime. To have Lula redeliver instead, call `POST /webhooks/{endpoint_id}/replay` with a `since` time.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.