A webhook lets prduct.com tell your system the moment an EUDR due diligence statement is ready, so your system no longer has to keep asking.
What webhooks do
Without webhooks, your system has to call the API again and again to ask whether the reference number is there yet. That can go on for hours, because EU TRACES takes its time to answer.
With a webhook, you give us the address of your system once. As soon as EU TRACES returns the reference and verification numbers, or refuses the statement, we send a short message to that address. Your system then fetches the full batch with one API call.
It works in three steps:
You add an endpoint. In prduct.com you enter the https address of your system and choose the events you want.
We notify you. When a statement is ready, or fails, we send a signed message to that address. It holds the ids of the batch and the statement.
You fetch the data. Your system checks that the message really came from us, then gets the batch with one API call.
Events you can subscribe to
Today you can be notified about the EUDR statements you submit to EU TRACES. More events will follow.
Event | Shown in prduct.com as | When we send it |
| "EUDR statement available" | EU TRACES returned the reference number and verification number for a due diligence statement (DDS) or simplified declaration (SD) you submitted. |
| "EUDR statement failed" | The statement will not get a reference number. The reason is in the message, see the next table. |
| "Test event" | You pressed "Send test event" on an endpoint. It goes to that endpoint only, and you can't subscribe to it. |
An eudr.dds.failed event says why in data.failure.reason:
Reason | What happened |
| EU TRACES gave the statement a final status: rejected, cancelled or withdrawn. That status is in |
| EU TRACES still had no reference number about 23 hours after you submitted. |
| Your company's EU TRACES connection was removed in prduct.com, so we can no longer ask for the status. |
| We could not follow up the statement: it has no EU TRACES identifier, or our status check stopped with an error. Contact support with the statement id. |
data.failure.message is a short technical note and can be empty. Check the statement in prduct.com for the details.
Before you start
You need three things:
An address on the internet that accepts POST requests, for example
https://erp.example.com/prduct/webhooks. It must start withhttps://. We don't send tohttp://, to addresses inside a private network such aslocalhostor192.168.x.x, or to addresses with a username and password in them.A bearer token for the API, so your system can fetch the batch after a notification. See Create new bearer token in prduct.com.
Access to "My Organization" in prduct.com, where the webhook settings live.
To test on your own computer, put a public https tunnel (for example ngrok or Cloudflare Tunnel) in front of it and use the tunnel's address.
Add a webhook endpoint
Go to "My Organization", then "Webhooks".
Click "Add endpoint".
Fill in the fields (see the table below) and click "Add endpoint".
Copy the signing secret shown at the top of the page and store it safely in your system. It starts with
whsec_. We show it only once. If you lose it, rotate the secret to get a new one (see "Rotate the signing secret").
Field | Description |
Endpoint URL | The https address we send events to. |
Description (optional) | A note for your team, for example "ERP production". |
Events to send | The events this endpoint receives. Choose at least one. |
A company can have up to 10 endpoints, for example one for production and one for testing. Each endpoint has its own signing secret. To change an endpoint's address or events later, use the pencil icon on its row.
Send a test event
Check your setup before a real statement comes back. Click the paper-plane icon ("Send test event") on the endpoint's row.
We send a webhook.test event right away and show the result at the top of the page: "Test event delivered (HTTP 200)" or "Test event failed" with the reason. The test also appears under "Recent deliveries", where you can see exactly what we sent and what your system answered.
A test event is signed like a real one, so it is the best way to check your signature code. A failed test never disables your endpoint.
What we send
Every event is an HTTP POST to your endpoint, with a JSON body and these headers:
Header | Example | Meaning |
|
| The event's unique id. It stays the same on every retry, so use it to ignore duplicates. |
|
| When this attempt was sent, in Unix seconds. |
|
| Proof that the request comes from us. See the next section. |
|
| |
|
|
The body always has three fields: type (the event), timestamp (when the event happened, in UTC) and data. The data only identifies what changed. You fetch the full record from the API (see "Fetch the data").
An eudr.dds.available event:
{
"type": "eudr.dds.available",
"timestamp": "2026-10-26T09:41:12Z",
"data": {
"batch": {
"id": 48213,
"uuid": "9b2f0c5e-4d1a-4c3b-8e7f-2a1b3c4d5e6f",
"external_id": "SO-2026-0042-B1"
},
"statement": {
"id": 48220,
"uuid": "1e2d3c4b-5a69-4788-9a0b-c1d2e3f4a5b6",
"type": "dds",
"reference_number": "26NLSN6LX69730",
"verification_number": "K7R8LA90"
}
}
}An eudr.dds.failed event has the same batch and statement (without the two numbers), plus failure:
{
"type": "eudr.dds.failed",
"timestamp": "2026-10-26T09:41:12Z",
"data": {
"batch": { "id": 48213, "uuid": "9b2f0c5e-4d1a-4c3b-8e7f-2a1b3c4d5e6f", "external_id": "SO-2026-0042-B1" },
"statement": { "id": 48220, "uuid": "1e2d3c4b-5a69-4788-9a0b-c1d2e3f4a5b6", "type": "dds" },
"failure": { "reason": "rejected", "traces_status": "REJECTED", "message": null }
}
}Field | Meaning |
| Three ways to identify the batch the statement belongs to. |
|
|
| The numbers EU TRACES returned. |
A webhook.test event carries only {"endpoint_id": 12} in data.
We send the body on a single line. It is shown formatted here for reading.
Check that the request really comes from prduct.com
Your endpoint is a public address, so anyone could send it a request. The signature proves that a request comes from us and was not changed on the way. Only you and prduct.com know the signing secret. We use it to compute a code from the request, and your system computes the same code and compares the two. If they match, the request is genuine.
We follow the open Standard Webhooks scheme, so you can also use one of its ready-made libraries instead of the code below.
To check a request:
Read the raw body exactly as it arrived, before any JSON parsing. Parsing and re-encoding changes spaces or key order, and the signature no longer matches.
Take your signing secret, remove the
whsec_prefix and base64-decode the rest. The result is your key.Join three values with dots:
webhook-id+.+webhook-timestamp+.+ raw body.Compute an HMAC-SHA256 of that text with your key, and base64-encode the result.
webhook-signatureholds one or more entries likev1,<signature>, separated by spaces. The request is genuine if your result equals one of the signatures. Compare in constant time.Reject the request if
webhook-timestampis more than 5 minutes away from your clock. This stops someone from re-sending an old request.
If the check fails, answer 401 and ignore the request.
Node.js (Express)
const crypto = require('crypto');
const express = require('express');
const app = express();
const SECRET = process.env.PRDUCT_WEBHOOK_SECRET; // whsec_...
app.post('/prduct/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
const id = req.get('webhook-id');
const timestamp = Number(req.get('webhook-timestamp'));
const signatures = (req.get('webhook-signature') || '').split(' ');
const body = req.body.toString('utf8');
if (!Number.isFinite(timestamp) || Math.abs(Date.now() / 1000 - timestamp) > 300) {
return res.status(400).send('Timestamp too old');
}
const key = Buffer.from(SECRET.replace(/^whsec_/, ''), 'base64');
const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${body}`).digest('base64');
const isValid = signatures.some((entry) => {
const [version, signature] = entry.split(',');
return version === 'v1' && Boolean(signature) && signature.length === expected.length
&& crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
});
if (!isValid) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(body);
// Put the event on your own queue, then answer right away.
res.sendStatus(200);
});PHP
$secret = getenv('PRDUCT_WEBHOOK_SECRET'); // whsec_...
$body = file_get_contents('php://input');
$id = $_SERVER['HTTP_WEBHOOK_ID'] ?? '';
$timestamp = $_SERVER['HTTP_WEBHOOK_TIMESTAMP'] ?? '';
$signatures = explode(' ', $_SERVER['HTTP_WEBHOOK_SIGNATURE'] ?? '');
if (! ctype_digit($timestamp) || abs(time() - (int) $timestamp) > 300) {
http_response_code(400);
exit('Timestamp too old');
}
$key = base64_decode(preg_replace('/^whsec_/', '', $secret));
$expected = base64_encode(hash_hmac('sha256', "{$id}.{$timestamp}.{$body}", $key, true));
$isValid = false;
foreach ($signatures as $entry) {
[$version, $signature] = array_pad(explode(',', $entry, 2), 2, '');
if ($version === 'v1' && hash_equals($expected, $signature)) {
$isValid = true;
}
}
if (! $isValid) {
http_response_code(401);
exit('Invalid signature');
}
$event = json_decode($body, true);
// Put the event on your own queue, then answer right away.
http_response_code(200);Python (Flask)
import base64, hashlib, hmac, os, time
from flask import Flask, abort, request
app = Flask(__name__)
SECRET = os.environ["PRDUCT_WEBHOOK_SECRET"] # whsec_...
@app.post("/prduct/webhooks")
def prduct_webhook():
webhook_id = request.headers.get("webhook-id", "")
timestamp = request.headers.get("webhook-timestamp", "")
signatures = request.headers.get("webhook-signature", "").split(" ")
body = request.get_data() # raw bytes
if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > 300:
abort(400)
key = base64.b64decode(SECRET.removeprefix("whsec_"))
signed_content = f"{webhook_id}.{timestamp}.".encode() + body
expected = base64.b64encode(hmac.new(key, signed_content, hashlib.sha256).digest()).decode()
if not any(
version == "v1" and hmac.compare_digest(signature, expected)
for version, _, signature in (entry.partition(",") for entry in signatures)
):
abort(401)
event = request.get_json()
# Put the event on your own queue, then answer right away.
return "", 200
To check your code without waiting for an event, use these values. Your code must accept them (skip the 5-minute check for this test):
Value | Test data |
Signing secret |
|
|
|
|
|
Raw body |
|
|
|
Fetch the data
After an eudr.dds.available or eudr.dds.failed event, get the batch with one API call. Use the batch id from the event:
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
https://api.prduct.com/api/v1/eudr/sales/batches/48213
You can also look the batch up by its uuid. Add ?by=document_id:
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
"https://api.prduct.com/api/v1/eudr/sales/batches/9b2f0c5e-4d1a-4c3b-8e7f-2a1b3c4d5e6f?by=document_id"
Use id or uuid to fetch the batch. external_id is there so you can match the batch to your own records.
Environment | API address |
Live |
|
Sandbox |
|
Use the API of the same environment where you added the endpoint. An endpoint added in the sandbox only receives sandbox events.
Answer the request, and what happens when it fails
Answer with any 2xx status (for example 200) within 15 seconds. Answer first and do the work afterwards: put the event on your own queue, reply 200, then fetch the batch.
Anything else counts as a failed delivery: another status code, no answer within 15 seconds, or no connection within 5 seconds. We then try again later:
Attempt | Waits after the previous attempt | Time since the first attempt |
1 | — | right away |
2 | 1 minute | 1 minute |
3 | 5 minutes | 6 minutes |
4 | 30 minutes | 36 minutes |
5 | 2 hours | about 2.5 hours |
6 | 5 hours | about 7.5 hours |
7 | 10 hours | about 17.5 hours |
8 | 14 hours | about 31.5 hours |
9 | 20 hours | about 51.5 hours |
10 | 24 hours | about 3 days |
Each wait varies by up to 10%, so not all retries arrive at the same second. After the 10th failed attempt we stop, and the delivery shows as "Failed".
Good to know:
The same event can arrive twice. For example, your system may have handled it but answered too late. Every retry has the same
webhook-id, so store the ids you have handled and skip the ones you've seen.Events can arrive out of order. Always fetch the batch to get its current state, rather than relying on the order of the events.
Redirects are not followed. A
301or302answer counts as a failure. Update the endpoint URL instead.410 Goneswitches the endpoint off at once. Answer410only when you want no more events at that address.An endpoint that fails for 5 days is switched off. If no event could be delivered to an endpoint for 5 days in a row, we disable it. Everyone in your company gets a message under "Notifications" in prduct.com.
While an endpoint is disabled, we send it nothing, and events from that time are not kept for it. When your system works again, click the play icon ("Enable endpoint") on its row. Then fetch the statements you missed through the API, and use "Retry delivery" for deliveries that failed.
Rotate the signing secret
Rotate the secret if it may have leaked, if you lost it, or as a regular security routine. You won't miss an event while you switch over.
Click the key icon ("Rotate signing secret") on the endpoint's row, then "Rotate secret".
Copy the new secret shown at the top of the page. As before, it is shown only once.
Put the new secret in your system within 24 hours.
For those 24 hours, we sign every request with both the old and the new secret, so webhook-signature holds two v1, entries. Code that accepts any matching entry (like the examples above) keeps working the whole time. The row shows "Old secret valid until" with the exact end time.
See what was sent
"Recent deliveries", at the bottom of the Webhooks page, lists the last 50 events sent to your endpoints. For each one it shows the event, the endpoint, the status (Pending, Succeeded or Failed), the HTTP status your system answered, and the number of attempts. A pending delivery also shows when the next attempt is due.
Open a delivery to see the exact body we sent, its webhook-id, and the start of your system's answer. This is usually the fastest way to find out why something went wrong.
A delivery that has failed for good can be sent again with "Retry delivery" (the circular-arrow icon). It starts a new round of attempts. We keep the delivery history for 30 days. Deleting an endpoint also deletes its history.
Troubleshooting
What you see | Why | What to do |
"The webhook URL must use https." | The address starts with | Serve your endpoint over https. |
"The webhook URL points to a private or reserved network address." | The address leads to | Use a public address. To test locally, use an https tunnel such as ngrok. |
"The webhook URL host could not be resolved." | The domain name doesn't exist (yet). | Check the spelling, or wait until the DNS record is live. |
"The webhook URL must not contain a username or password." | The address has | Remove it. The signature already proves the request is ours. |
Your code says the signature is wrong | The body was parsed and re-encoded before checking, the | Check against the raw body, compare your code with the steps above, and test it with the test data. |
Deliveries fail with a timeout | Your system needs more than 15 seconds to answer. | Answer |
"The endpoint redirected." | Your server answered with a redirect, for example from | Enter the final address as the endpoint URL. |
"The endpoint answered with HTTP 401" (or 403) | A firewall, login or API gateway in front of your endpoint refused the request. | Allow POST requests to that address without a login. Rely on the signature check instead. |
The endpoint shows "Disabled" | It answered | Fix the endpoint, click "Enable endpoint", then fetch the statements you missed. |
No event arrives at all | The endpoint isn't subscribed to the event, or the statement is still waiting for EU TRACES. | Check "Events" on the endpoint's row and "Recent deliveries". Send a test event to check the connection. |
Best practices
Always check the signature before you trust a request.
Answer
200right away and do the work in the background.Store each
webhook-idyou have handled, and skip repeats.Treat the event as a signal and fetch the batch for the details. Don't rely on the order the events arrive in.
Keep the signing secret out of your code repository, for example in an environment variable or a secrets manager.
Use a separate endpoint, and a separate secret, for testing and for production.
Keep a fallback: if you hear nothing about a statement for a day, look it up through the API.
