Skip to content

Webhooks ​

Pawdo can call an endpoint of yours when something happens to your orders, so you do not have to poll.

EventSent when
order.status_changedSomething about one of your orders changed — see below.
webhook.pingYou click Send test event in the seller app.

Subscribe ​

In the Pawdo seller app, open Integrations → Webhooks and click Add Webhook:

Field
Endpoint URLYour URL. It receives POST requests with a JSON body. Use HTTPS.
DescriptionOptional label.
EventsTick order.status_changed. Left empty, the webhook receives every event of the store, event types added later included. Either way, read X-NextFF-Event and ignore the types you do not handle.

After saving, the app shows the webhook's secret (shpat_…) once. Store it on your server: it signs every delivery. Lost it? Delete the webhook and add a new one.

On the same page, Send test event sends a webhook.ping to your URL, and Delivery Logs list every attempt with your answer's HTTP status and body. A webhook added while API access is not enabled for the store is created inactive.

The request ​

Every delivery is one POST with the event as the JSON body — no envelope — and these headers:

http
POST /hooks/pawdo HTTP/1.1
Content-Type: application/json
X-NextFF-Event: order.status_changed
X-NextFF-Delivery: d31fbcfb-0fa8-42d0-b347-76f36ebe9414
X-NextFF-Timestamp: 1794320216
X-NextFF-Signature: sha256=e3beac478f0f6cc276d63a55f93492f49d6d90f1b14a9db06d89a5a995db7088

{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
Header
X-NextFF-EventThe event type.
X-NextFF-DeliveryThe event id (UUID). The same on every retry of that event: use it to drop duplicates.
X-NextFF-TimestampUnix time, in seconds, when this attempt was signed.
X-NextFF-Signaturesha256= and the hex HMAC-SHA256 of the body (below).

Verify the signature ​

X-NextFF-Signature = "sha256=" + hex( HMAC-SHA256( secret, X-NextFF-Timestamp + "." + raw_body ) )
  • raw_body is the body exactly as received, before any JSON parsing: JSON parsed and serialized again may not match byte for byte.
  • Compare in constant time.
  • Reject a timestamp too far from your clock (5 minutes is common), so a captured request cannot be replayed later.

Node.js (Express):

js
const crypto = require("crypto")

app.post("/hooks/pawdo", express.raw({ type: "application/json" }), (req, res) => {
  const ts = req.get("X-NextFF-Timestamp") || ""
  const sig = req.get("X-NextFF-Signature") || ""
  const expected = "sha256=" + crypto.createHmac("sha256", process.env.PAWDO_WEBHOOK_SECRET)
    .update(ts + ".").update(req.body).digest("hex")
  const ok = sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))
  if (!ok || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(401)

  res.sendStatus(200)                           // answer first …
  queue.push(JSON.parse(req.body.toString()))   // … then do the work
})

Python:

python
import hashlib, hmac, time

def verify(secret: str, timestamp: str, raw_body: bytes, signature: str) -> bool:
    mac = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest("sha256=" + mac, signature) and abs(time.time() - int(timestamp)) <= 300

Go:

go
func verify(secret, timestamp string, rawBody []byte, signature string) bool {
	mac := hmac.New(sha256.New, []byte(secret))
	mac.Write([]byte(timestamp + "."))
	mac.Write(rawBody)
	expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
	return hmac.Equal([]byte(expected), []byte(signature))
}

Check your code against the request above. It was signed with this secret, of a test environment:

secretshpat_ltm0rh_UPGso4t7JeCh2PEnZOLgQVXjt7rwjN4p2vck
X-NextFF-Timestamp1794320216
body{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
X-NextFF-Signaturesha256=e3beac478f0f6cc276d63a55f93492f49d6d90f1b14a9db06d89a5a995db7088

(The timestamp check fails on it, of course: it is in the past.)

Answer, retries, order ​

  • Answer 2xx within 15 seconds. Any other status, a timeout or a refused connection is a failure. Do the work after answering — queue it — rather than before.
  • A failed delivery is tried again: 3 attempts in all, the last one about two minutes after the first. After the third failure the event is dropped — it stays in Delivery Logs, and the data is still on the API.
  • Deliveries are not in order, and the same event can arrive twice (a retry after a timeout you did answer). Drop repeats by X-NextFF-Delivery, then read the order with Get one order and store what it says: the event itself does not carry the order's state.

order.status_changed ​

Sent for an order of the store — of any source (API, CSV, Shopify…) — when one of these happens:

  • Pawdo finishes validating it and marks it valid, or finds a problem with its address (invalid, exception, unavailable) or its artwork (design_status error, missing, invalid_dim);
  • Pawdo records the result of sending it to production (accepted, or an error);
  • one of its packages gets a tracking number, or the tracking number shown for a package changes;
  • it is held, released or cancel-shipped through the API (Order holds and cancel-ship);
  • PATCH /orders/{id}.json changes it without sending it back to validation.

It is not sent for every change — not for payment, production progress or delivery, for example — and the body does not carry the order's new state. On each event, read the order with GET /orders/query.json?id=… and store what it says; to see changes the event does not cover, keep reading GET /order.json on a schedule.

The body's type is order_update, the event's older name: branch on the X-NextFF-Event header (order.status_changed), not on type.

json
{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
Field
typeAlways order_update.
reference_idThe order's order_number — yours, as sent or imported.
order_idPawdo's order id: read the order with it.

webhook.ping ​

Sent by Send test event in the seller app, signed like every other delivery:

json
{
  "message": "This is a test webhook delivery",
  "type": "webhook.ping"
}

If you have any questions about the API, please contact the Pawdo support team via Facebook.