Skip to main content
Webhooks tell your system that a shipment changed, without polling. A merchant has one webhook: the resource is /api/v2/external/webhook, singular.

Register it

Omit events to subscribe to all ten. To narrow it, list the ones you act on:
The 201 response carries the endpoint and the signing secret. Repeating the same request returns the same endpoint and secret with 200:
subscribedEventTypes is a set; its order has no meaning.
signingSecret is disclosed on creation and on rotation only. GET /api/v2/external/webhook never returns it. Store it immediately.

Events

An endpoint created before the newer events existed keeps its own list; add them with PATCH.

The delivery

Example delivery:
Every event carries shipmentId, reference, merchantCompanyId (the store), status, lifecycleState, shipmentVersion, deliveryFeeAmount, deliveryFeeCurrency, and proofAvailable. reasonCode is added on shipment.failed and shipment.cancelled; eta on shipment.eta_updated. sequence equals shipmentVersion. Several events can share one value — shipment.eta_updated does not change the shipment’s version — so deduplicate on Webhook-Id, not on sequence. Deliveries of different events are not ordered: a retried shipment.created can arrive after shipment.no_driver_available for the same shipment, so apply events by sequence and ignore an older one.
status is the same status the shipment read returns. lifecycleState is DropHub’s internal state name (for example PENDING_APPROVAL, ACCEPTED, DELIVERY_FAILED); it is kept for existing receivers — use status.
Several stores may use one receiver URL; data.merchantCompanyId identifies the store and each store has its own signing secret.

Verifying the signature

The signed message is:
The HMAC key is the decoded secret: base64url-decode the 43-character signingSecret to 32 bytes. Verify against the raw bytes you received, before any JSON parsing.
Reject deliveries whose Webhook-Timestamp is far from your clock.

Responding and retries

Return a 2xx quickly and process asynchronously. HTTP 408, 425, 429, 5xx, timeouts, and transport failures are retried with the same Webhook-Id, body, and Idempotency-Key, and a fresh timestamp and signature. The delay before attempt n is a random value up to 30 seconds × 2n−1, capped at 1 hour; Retry-After is honoured up to 1 hour. After 8 attempts the event is not retried again. There is no replay or test-send API. After an outage, read the shipments you care about — the current status is authoritative.

Changing it

PATCH, DELETE, and rotation require the endpoint’s current version in If-Match (from GET or the last response’s ETag). Missing → 428; stale → 412.
PATCH accepts url, status (ACTIVE or PAUSED), and events. An unknown event name answers 422 UNSUPPORTED_EVENT_TYPE.
After DELETE /api/v2/external/webhook you can register a new webhook; it gets a new signing secret. While a webhook exists, a second POST with a different body is refused with 409 IDEMPOTENCY_KEY_REUSED.

Rotating the secret

Rotation returns a new signingSecret and sets previousSecretValidUntil 24 hours ahead. Every delivery sent after the rotation — including retries of earlier events — is signed with the new secret only, so switch your verifier to it as soon as you receive it. Keep accepting the old secret only for deliveries already in your queue.