PeppolKit webhooks

Rather not keep asking the API whether something happened? Give PeppolKit an https address on your own server. As soon as an invoice is made, delivered over Peppol or not delivered, we send a message there.

Start free How it works

Set up a webhook

Every shop with a PeppolKit dashboard can set up a webhook. If your shop runs on your own system, it is in the dashboard under API › Webhooks; on the other integrations under Bookkeeping, on the Webhooks tab. Enter the address and choose the messages you want. You then get a secret (whsec_…), shown once, to check the messages with.

With an API key you can also set it up through the API:

curl -X PUT https://app.peppolkit.com/api/v1/webhook \
  -H "Authorization: Bearer pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://jouwserver.example/peppolkit",
    "events": ["invoice.created", "invoice.failed"],
    "enabled": true
  }'

Leave out events and you get every message. The secret (secret) is only in the answer when this call creates the webhook, or when you send "rotateSecret": true. GET /webhook shows the setting and DELETE /webhook removes it.

The messages

invoice.delivered and invoice.failed cover credit notes too; data.type says which it is. Each message comes at most once per document, and the order is not guaranteed.

What a message holds

Every message is a POST with JSON:

POST https://jouwserver.example/peppolkit
Content-Type: application/json
PeppolKit-Event: invoice.created
PeppolKit-Delivery: cmhx2k9qv0001abcd1234efgh
PeppolKit-Signature: t=1794700800,v1=5f2b0c…

{
  "id": "evt_c1aa45148e3a990f7151aa9d42689128",
  "type": "invoice.created",
  "created": "2026-11-14T10:00:00.000Z",
  "data": {
    "number": "2026-00042",
    "type": "invoice",
    "orderId": "1001",
    "total": 121,
    "currency": "EUR",
    "peppolStatus": "pending",
    "pdfUrl": "https://app.peppolkit.com/i/…",
    "ublUrl": "https://app.peppolkit.com/i/…?format=xml"
  }
}

Check the signature

Every message carries a PeppolKit-Signature header with t, the time in seconds, and v1: the HMAC-SHA256 of t.body with your secret as key. Compute it over the body exactly as it arrived, not over rebuilt JSON, and refuse a message whose t is more than five minutes old. In Node:

import { createHmac, timingSafeEqual } from "node:crypto";

function verify(rawBody, header, secret) {
  const t = /(?:^|,)t=(\d+)/.exec(header ?? "")?.[1];
  const v1 = /(?:^|,)v1=([0-9a-f]{64})/.exec(header ?? "")?.[1];
  if (!t || !v1 || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = createHmac("sha256", secret).update(t + "." + rawBody).digest();
  return timingSafeEqual(expected, Buffer.from(v1, "hex"));
}

In PHP:

<?php
$secret = getenv('PEPPOLKIT_WEBHOOK_SECRET'); // whsec_…
$raw = file_get_contents('php://input');
$header = $_SERVER['HTTP_PEPPOLKIT_SIGNATURE'] ?? '';

$ok = preg_match('/(?:^|,)t=(\d+)/', $header, $t)
    && preg_match('/(?:^|,)v1=([0-9a-f]{64})/', $header, $v1)
    && abs(time() - (int) $t[1]) <= 300
    && hash_equals(hash_hmac('sha256', $t[1] . '.' . $raw, $secret), $v1[1]);

if (!$ok) {
    http_response_code(400);
    exit;
}
$event = json_decode($raw, true);
http_response_code(204);

Answering and retries

Answer within 10 seconds with a 2xx status; we do not read what you send back. So do the work after you answer. Another status (a redirect too), no answer in time or a connection error counts as failed. We then try again after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours: six attempts over about 15 hours. After that the message is marked as not delivered.

Test messages

In the dashboard you send a test message with one click. It is a webhook.test with a made-up invoice (TEST-0001, without links). It always goes out and is never retried.

When you work with a test key (pk_test_, see Testing without real invoices), the same webhook gets the messages of your test invoices, exactly as live, with "test": true at the top and in data. Real messages have no test field. Peppol delivery is simulated: invoice.delivered within a minute, or invoice.failed for the VAT number BE0000000196. The webhook itself cannot be changed with a test key.

{
  "id": "evt_5d0e…",
  "type": "invoice.created",
  "test": true,
  "created": "2026-11-18T10:00:00.000Z",
  "data": {
    "number": "TEST-2026-00001",
    "type": "invoice",
    "test": true,
    "peppolStatus": "pending",
    "pdfUrl": "https://app.peppolkit.com/i/…"
  }
}

Frequently asked questions

Does a webhook cost anything?

No. Webhooks are in every plan, the free plan included.

Is a webhook only for an own system?

No. Every shop with a PeppolKit dashboard can set one up, on WooCommerce, PrestaShop or another integration too: in the dashboard under Bookkeeping, on the Webhooks tab. The Shopify app does not have it.

What if my server is unreachable for a while?

We try each message six times over about 15 hours. The dashboard shows which messages did not arrive.

Can I give more than one address?

No, a shop has one webhook. To get the messages in more places, pass them on from your own server.

Leave Peppol to PeppolKit

Install PeppolKit and your business customers get their invoice over Peppol, without you having to deal with the network.

Choose your platform Start free with 20 invoices a month.

An explanation for orientation, not tax advice.