Ricevi notifiche in tempo reale quando i dati cambiano. Brutlers invia HTTP POST request all'URL registrato.
Registra un URL in grado di ricevere HTTP POST request. Riceverai un secret per la verifica della firma.
/api/vendor/webhooksRegistra un nuovo webhook. Il secret viene mostrato una sola volta.
curl -X POST https://brutlers.com/api/vendor/webhooks \
-H "X-Api-Key: brut_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://meine-app.de/webhooks/brutlers",
"events": ["order.created", "order.status_changed"]
}'Massimo 5 webhook per vendor
| Event | Description |
|---|---|
| order.created | Nuovo ordine creato |
| order.status_changed | Stato dell'ordine modificato |
| inquiry.received | Nuova richiesta ricevuta |
| appointment.confirmed | Appuntamento confermato |
| appointment.cancelled | Appuntamento annullato |
| customer.created | Nuovo cliente creato |
Ogni webhook request contiene un JSON body con il tipo di evento e i dati correlati.
{
"event": "order.status_changed",
"data": {
"id": "clx1234567890abcdef",
"status": "FITTING_READY",
"previousStatus": "IN_PRODUCTION",
"customerId": "clx0987654321fedcba",
"updatedAt": "2026-04-15T10:00:00.000Z"
},
"timestamp": "2026-04-15T10:00:01.234Z"
}Ogni request contiene un header con firma HMAC-SHA256. Verifica la firma per assicurarti che la request provenga da Brutlers.
Header
X-Brutlers-Signatureimport { createHmac } from "crypto";
function verifySignature(body, signature, secret) {
const expected = createHmac("sha256", secret)
.update(body)
.digest("hex");
return signature === expected;
}
// Express/Next.js example
app.post("/webhooks/brutlers", (req, res) => {
const signature = req.headers["x-brutlers-signature"];
const body = JSON.stringify(req.body);
if (!verifySignature(body, signature, process.env.WEBHOOK_SECRET)) {
return res.status(401).send("Invalid signature");
}
const { event, data } = req.body;
console.log(`Event: ${event}`, data);
res.status(200).send("OK");
});In caso di errori (stato ≠ 2xx o timeout), il webhook viene ripetuto fino a 3 volte:
/api/vendor/webhooksRegistra un nuovo webhook. Il secret viene mostrato una sola volta.
/api/vendor/webhooks/:idAggiorna URL, eventi o stato di un webhook.
/api/vendor/webhooks/:idElimina un webhook e tutti i relativi log di consegna.