Skip to content
Waypost

API and webhooks

A REST API with key authentication, an OpenAPI 3 specification and signed webhooks. Test keys (wp_test_…) are free and use a test carrier, so you can build without shipping anything.

1. Register a shipment

The carrier is recognized from the number. With Idempotency-Key a repeated request creates no duplicates.

curl -X POST https://waypost.euroformaz.com/v1/trackings \
  -H "Authorization: Bearer wp_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1001" \
  -d '{"trackings": [{"number": "VT123456789", "order_ref": "ORD-1001"}]}'

2. Receive status changes

Every delivery has a unique event_id and, if your server does not answer, it is retried for almost a day. Events: tracking.updated, tracking.delivered, tracking.exception, tracking.expired.

POST https://your-shop.com/webhooks/waypost
X-Signature: t=1791135151,v1=5f2b…
X-Waypost-Event-Type: tracking.delivered

{
  "event_id": "0199…",
  "type": "tracking.delivered",
  "data": {
    "previous_status": "out_for_delivery",
    "tracking": {
      "number": "VT123456789",
      "carrier": "gls-it",
      "status": "delivered",
      "status_label": "Consegnata",
      "order_ref": "ORD-1001",
      "events": [ … ]
    }
  }
}

3. Verify the signature

// Node.js: signature check
const [t, v1] = header.split(",").map((p) => p.split("=")[1]);
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))
  && Math.abs(Date.now() / 1000 - Number(t)) < 300;

Endpoints

POST/v1/trackingsRegisters up to 100 numbers, with optional carrier and order reference
GET/v1/trackings/{id}Status and event history
GET/v1/trackingsList with filters by status, carrier and date, cursor pagination
DELETE/v1/trackings/{id}Stops following the shipment and frees its slot
POST/v1/detectCandidate carriers for a number, without registering it
GET/v1/carriersSupported carriers
POST/v1/webhooksAdds a notification endpoint
GET/v1/usageUsage against the plan

Normalized statuses

pending, info_received, in_transit, out_for_delivery, available_for_pickup, exception, failed_attempt, delivered, returned, expired — standard codes, the same for every carrier and in every language; status_label describes them in English or Italian (Accept-Language or ?lang=en) and the carrier's original text is always kept.