Skip to content

Webhooks

What BIRP sends to your webhook endpoints when data changes, and how to receive it.

Version v1.2, updated

On this page

A webhook is a POST request that BIRP sends to a URL of yours when data of the company changes. Your system learns about a new order or a changed stock level without asking the API again and again.

What BIRP sends

Each request carries one event as a JSON body: its id, its type, when the change happened, the version of the contract, and the record the event is about.

Body of product.updatedJSON
{
  "api_version": "v1",
  "data": {
    "archived_at": null,
    "barcode": "2000000000015",
    "category_id": "00000000-0000-4000-8000-000000000021",
    "created_at": "2026-09-01T07:30:00.000Z",
    "currency": "MDL",
    "external_ids": [
      {
        "external_id": "1042",
        "source": "woocommerce"
      }
    ],
    "id": "00000000-0000-4000-8000-000000000011",
    "image_url": null,
    "kind": "goods",
    "name": "Wheat flour 25 kg",
    "price": "12.50",
    "sku": "SP-FLOUR-25",
    "status": "active",
    "unit": "kg",
    "updated_at": "2026-09-28T14:05:12.417Z"
  },
  "id": "00000000-0000-4000-8000-000000000101",
  "occurred_at": "2026-09-28T14:05:12.417Z",
  "type": "product.updated"
}

Field

What it holds

id

The id of the event. It stays the same on every attempt, so you can process each event once.

type

The type of the event, such as order.confirmed. Webhook events lists them.

occurred_at

When the change happened, in UTC. For changes merged into one event, the time of the first.

api_version

The version of the contract data follows: v1.

data

The record, as the API returns it.

The data is the state when the event is sent

data is the record as the API returns it when BIRP sends the event, not a copy taken at the time of the change. Updates of a record made within a few seconds arrive as one event, with the final state.

A category, a customer, an order or an invoice deleted in BIRP comes as its id and "status": "deleted". A product removed from BIRP for good comes as archived.

At least once, in no fixed order

  • An event can arrive more than once. After a timeout, for example, BIRP tries again even if your system received the first attempt.

  • Events can arrive out of order. Before you overwrite a record, compare updated_at: skip the event only when the one you hold is later. A stock level has none, so read it from the API when the order matters.

  • An event about a record deleted before the event went out is not sent. Its deletion event is, so you can receive a deletion for a record you never heard of.

  • Handle each event once shows how.

Headers

Header

What it holds

BIRP-Event-Id

The id of the event, the same as id in the body.

BIRP-Event-Type

The type of the event, the same as type in the body.

BIRP-Signature

The time of sending and the signature of the body. See Verify webhook signatures.

BIRP-Delivery-Attempt

The number of the attempt, from 1.

User-Agent

BIRP-Webhooks/1.0.

Content-Type

application/json.

Steps

  1. Add a webhook endpoint in BIRP and choose its events. See Register a webhook endpoint.

  2. Check the signature of every request. See Verify webhook signatures.

  3. Store the event and answer with a 2xx status within 10 seconds; do the work after. See Retries and pauses.

  • register-webhook-endpoint
  • verify-webhook-signatures
  • webhook-events
  • handle-webhooks-once