Skip to content

Combine the public API with webhooks

Get a notice when something changes (orders, products, stock, customers) and read the details with the API, without polling every minute.

The idea

Webhooks notify; the API fetches the data. Instead of asking every minute whether there are new orders, subscribe to the events and, when one arrives, ask for the details with your API key.

Subscribe to the events

  1. Go to Online shop › Online shop settings › Webhooks.
  2. Create a subscription with your https:// address and choose the events: order.created, order.paid, order.cancelled, product.updated, inventory.changed and customer.created.
  3. Keep the signing secret: it is shown once.

When an event arrives

  1. Check the signature: the X-Bizq-Signature header carries v1= and the HMAC-SHA256 of the secret over X-Bizq-Timestamp, a dot and the body. Reject anything that does not match or is old.
  2. Answer right away with a 2xx. Otherwise BizQ retries for 24 hours.
  3. Read the details with the API: for example GET /api/v1/public/v1/orders/ID after order.created, or GET /api/v1/public/v1/stock?productId=ID after inventory.changed.

Tips

  • The same event may arrive twice: use X-Bizq-Delivery-Id so you do not process it twice.
  • As a safety net, run a periodic sync with updatedSince (for example, every night) in case a notice was lost.
  • To create orders from your website use POST /orders with Idempotency-Key: a retry never creates a double order.
Back to the help centre