Set up webhooks
Receive updates when quotes, orders, customers, payments, Inbox messages, purchase orders or warranty claims change. OrderPilot sends a signed event to your HTTPS address. Your server verifies it, responds and fetches the latest record.
Build a receiver in Node or Python, send a test event and learn how to recover missed updates.
What you’ll need
API access
Ask us to enable the API for your store. You can then create keys in Settings › API and integrations.
A public HTTPS address
The address can’t use localhost or a private network, or contain a username or password.
Secure secret storage
Save the signing secret in an environment variable or secret manager. It’s shown only once.
A queue
Store events for processing so your receiver can respond promptly.
In these examples, $BASE means https://api.meetorderpilot.com/connect/v1 and $ORDERPILOT_KEY is your API key.
Build and test the receiver
Step 1: Create a key with webhook access
Create a key with Manage webhooks in Settings›API and integrations. Add the read permission listed for each event you need. You can receive events only for records your key can read.
Event What triggers it Required permission quote.created A new quote is created Read quotes quote.updated A quote is updated Read quotes order.created A new order is created Read orders order.updated An order is updated Read orders customer.created A customer record is created Read customers customer.updated A customer record is updated Read customers payment.received A full or partial payment is recorded Read orders conversation.message_received The Inbox receives a customer message or vendor email Read the Inbox purchase_order.created A purchase order is created Read purchase orders purchase_order.updated A purchase order is updated Read purchase orders purchase_order.received Items on a purchase order are received Read purchase orders warranty_claim.created A warranty claim is created Read warranty claims warranty_claim.status_changed A warranty claim’s status changes Read warranty claims Webhooks stop if the key used to create them expires or is revoked.
Step 2: Register the receiving address
Send your HTTPS address and chosen events to
POST /webhooks. Include the requiredIdempotency-Keyso retrying returns the original response without creating another webhook.curl -X POST $BASE/webhooks \ -H "Authorization: Bearer $ORDERPILOT_KEY" \ -H "Idempotency-Key: 3b8f2c1e-erp-webhook" \ -H "Content-Type: application/json" \ -d '{ "url": "https://hooks.harlowandfinch.example/orderpilot", "events": ["quote.updated", "order.updated", "payment.received"] }'
const BASE = "https://api.meetorderpilot.com/connect/v1"; const res = await fetch(`${BASE}/webhooks`, { method: "POST", headers: { Authorization: `Bearer ${process.env.ORDERPILOT_KEY}`, "Idempotency-Key": "3b8f2c1e-erp-webhook", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://hooks.harlowandfinch.example/orderpilot", events: ["quote.updated", "order.updated", "payment.received"], }), }); console.log(res.status, await res.json());
import os import requests BASE = "https://api.meetorderpilot.com/connect/v1" res = requests.post( f"{BASE}/webhooks", headers={ "Authorization": f"Bearer {os.environ['ORDERPILOT_KEY']}", "Idempotency-Key": "3b8f2c1e-erp-webhook", }, json={ "url": "https://hooks.harlowandfinch.example/orderpilot", "events": ["quote.updated", "order.updated", "payment.received"], }, ) print(res.status_code, res.json())
{ "id": "cm3xw9k2b0004whf8ka1z7q2d", "url": "https://hooks.harlowandfinch.example/orderpilot", "events": ["quote.updated", "order.updated", "payment.received"], "active": true, "secret": "whsec_••••••••••••••••••••••Qm7X", "created_at": "2026-11-18T14:05:31Z" }Save the secret nowSave secret from this response. Retrying with the same key returnssecret_redacted: truewithout the secret. If you lose it, follow Replace a lost secret.You can register up to 10 webhooks per key and 25 per store.
Step 3: Verify each event’s signature
Each event includes
OrderPilot-Signature: t=…,v1=…. Calculatev1by applying HMAC-SHA256 to"<t>.<raw body>"with your secret. Compare signatures in constant time. Reject events with atmore than five minutes old.POST /orderpilot Content-Type: application/json User-Agent: OrderPilot-Webhooks/1 OrderPilot-Delivery: cm3xwb7tq0009whf8m2k4p8sz OrderPilot-Signature: t=1795016531,v1=ff4f2770cee955e9…7a8176f2a461 { "id": "evt_6f1c2a9b0d4e8f7a3b5c1d2e", "type": "quote.updated", "created_at": "2026-11-18T15:42:11Z", "data": { "id": "qt_8KX2M4", "kind": "quote" } }
import crypto from "node:crypto"; // raw: the body exactly as it arrived (a Buffer), before JSON.parse export function verify(header, raw, secret) { const parts = header.split(",").map((p) => p.trim().split("=")); const t = Number(parts.find(([k]) => k === "t")?.[1]); const age = Math.abs(Date.now() / 1000 - t); if (!Number.isInteger(t) || age > 300) return false; const expected = crypto.createHmac("sha256", secret) .update(`${t}.`).update(raw).digest(); // for 24 hours after a rotation there are two v1 values: either may match return parts.filter(([k]) => k === "v1").some(([, v = ""]) => { const given = Buffer.from(v, "hex"); return given.length === expected.length && crypto.timingSafeEqual(given, expected); }); }
import hashlib import hmac import time # raw: the body exactly as it arrived (bytes), before json.loads def verify(header: str, raw: bytes, secret: str) -> bool: parts = [p.strip().split("=", 1) for p in header.split(",")] try: t = int(next(v for k, v in parts if k == "t")) except (StopIteration, ValueError): return False if abs(time.time() - t) > 300: return False expected = hmac.new(secret.encode(), f"{t}.".encode() + raw, hashlib.sha256).hexdigest() # for 24 hours after a rotation there are two v1 values: either may match return any(hmac.compare_digest(v.encode(), expected.encode()) for k, v in parts if k == "v1")
When replacing a secretFor 24 hours afterPOST /webhooks/{id}/rotate-secret, the header includes twov1signatures, one for each secret. Accept either while updating your receiver, then remove the old secret.Step 4: Respond within 8 seconds
Return any 2xx status. The eight-second timeout covers the connection, TLS and your response, including any time spent sending it. OrderPilot ignores the response body.
Return 200 before processingQueue the event and respond. Process the queued event to fetch and save the record.import express from "express"; const app = express(); // express.raw keeps the body as bytes, so the signature can be checked app.post("/orderpilot", express.raw({ type: "application/json" }), (req, res) => { const header = req.get("OrderPilot-Signature") ?? ""; if (!verify(header, req.body, process.env.ORDERPILOT_WEBHOOK_SECRET)) { return res.sendStatus(400); } // answer first: the whole attempt is cut off after 8 seconds res.sendStatus(200); // then hand the event to your own queue jobs.add(JSON.parse(req.body)); });
import json import os from flask import Flask, request app = Flask(__name__) @app.post("/orderpilot") def orderpilot(): header = request.headers.get("OrderPilot-Signature", "") # get_data() keeps the body as bytes, so the signature can be checked raw = request.get_data() if not verify(header, raw, os.environ["ORDERPILOT_WEBHOOK_SECRET"]): return "", 400 # hand the event to your own queue, then answer: the whole attempt is cut off after 8 seconds jobs.add(json.loads(raw)) return "", 200
Step 5: Skip repeat events and fetch the record
The same event can arrive again if OrderPilot didn’t receive your response. Save each processed event’s
idand skip any you’ve already handled.The event’s
dataincludes only the record’sidandkind. Fetch the record to read its current details.const BASE = "https://api.meetorderpilot.com/connect/v1"; const PATHS = { quote: "quotes", order: "orders", customer: "customers" }; // runs from your queue, after you answered async function handle(event) { if (event.type === "ping") return; // at least once: the same event can arrive twice if (await seen(event.id)) return; // a thin event: fetch the record for its current state const { id, kind } = event.data; const res = await fetch(`${BASE}/${PATHS[kind]}/${id}`, { headers: { Authorization: `Bearer ${process.env.ORDERPILOT_KEY}` }, }); await saveToErp(await res.json()); await markSeen(event.id); }
import os import requests BASE = "https://api.meetorderpilot.com/connect/v1" PATHS = {"quote": "quotes", "order": "orders", "customer": "customers"} # runs from your queue, after you answered def handle(event): if event["type"] == "ping": return # at least once: the same event can arrive twice if seen(event["id"]): return # a thin event: fetch the record for its current state kind, record_id = event["data"]["kind"], event["data"]["id"] res = requests.get( f"{BASE}/{PATHS[kind]}/{record_id}", headers={"Authorization": f"Bearer {os.environ['ORDERPILOT_KEY']}"}, ) save_to_erp(res.json()) mark_seen(event["id"])
Count payments, not eventspayment.receivedincludes the order’s ID. Record revenue for each payment, since events can repeat.Step 6: Test delivery
Call
POST /webhooks/{id}/pingto send apingevent. The request returns before your server responds. CheckGET /webhooks/{id}/deliveriesfor the result. It lists the last 50 deliveries, kept for a week.# send a test event to this webhook now curl -X POST $BASE/webhooks/cm3xw9k2b0004whf8ka1z7q2d/ping \ -H "Authorization: Bearer $ORDERPILOT_KEY" # then see what happened curl $BASE/webhooks/cm3xw9k2b0004whf8ka1z7q2d/deliveries \ -H "Authorization: Bearer $ORDERPILOT_KEY"
{ "items": [ { "event_id": "evt_8Pq3Lm1", "type": "ping", "state": "DELIVERED", "attempts": 1, "last_status": 200, "last_error": null, "created_at": "2026-11-18T15:30:04Z", "delivered_at": "2026-11-18T15:30:04Z", "next_attempt_at": "2026-11-18T15:30:04Z" } ] }Check
state:PENDINGmeans delivery attempts remain. The final state isDELIVEREDorFAILED.
Delivery timing and retries
Delivery starts when the record changes. Changes made close together to one record become one event, sent about two seconds after the first change. Customer and payment updates are checked every minute, so those events can arrive about a minute later.
- 1First attemptabout 2 s after the change
- 2+1 mafter the last failure
- 3+5 mafter the last failure
- 4+30 mafter the last failure
- 5+2 hafter the last failure
- 6+6 hafter the last failure
- ✕FAILEDNo further attempts
Each attempt has a fresh signature with a new t. Six attempts are made, ending about eight and a half hours after the first.
| Failed attempt | Your response isn’t 2xx, the attempt takes over 8 seconds or the address can’t be reached. |
| 410 Gone | That delivery stops at once, with no more attempts. |
| 20 consecutive failures | After 20 failed deliveries in a row, OrderPilot turns the webhook off (active: false) and emails the store owner. |
| 3 days | A delivery waiting more than 3 days becomes FAILED, with last_error set to EXPIRED. |
| 5,000 pending deliveries | Above this limit, the oldest deliveries become FAILED with OVERFLOW. OrderPilot emails the store owner. |
| Address restrictions | OrderPilot won’t follow redirects or send to an address that resolves to a private network. |
| Delivery rate | Each webhook can have up to 2 attempts running at once. A working receiver handles about 130 a minute. |
updated_since.If something goes wrong
Signatures never match
Use the body exactly as received, before parsing JSON, with <t>. before it. Use the secret returned when you registered the webhook; it starts with whsec_.
Delivery times out
Each attempt ends after 8 seconds. Return 2xx before processing the event from your queue.
An event arrives again
Retries can repeat events. Save processed event IDs and skip repeats.
The test says the webhook is off
OrderPilot turned it off after 20 consecutive delivery failures. Fix the receiver, register the webhook again and use updated_since to catch up.
Deliveries show EXPIRED or OVERFLOW
They waited more than 3 days, or the queue exceeded 5,000 deliveries. Read the lists with updated_since to recover missed updates.
An event can’t be registered
Add its required read permission to the key, such as Read quotes, Read orders or Read customers.
The webhook limit is reached
Each key allows 10 webhooks and each store allows 25. Remove an unused webhook with DELETE /webhooks/{id}.
The address is rejected
Use a public HTTPS address without a username or password. Private addresses aren’t allowed.
The secret is lost
Get a replacement with POST /webhooks/{id}/rotate-secret. Events remain signed with the old secret for 24 hours while you update your receiver.
Next steps
updated_sinceView webhook eventsReference · Find each event’s trigger and an exampleWebhook referenceAPI reference · 6 endpoints: Register and manage webhooks, replace secrets, test delivery and read results