endpoint URL, and only receives events for its subscribed serviceType running in its environment.
When a matching event occurs, Vouchmark POSTs a signed JSON payload to your endpoint. Verify every delivery with the webhook’s signing secret before trusting it.
The registration model
A webhook registration has these fields:The signing secret
Each webhook has its own signing secret in the formwhsec_....
- The full secret is returned only once, in the response to create and rotate. Store it securely the moment you receive it.
- In the list response and the dashboard, the secret is masked (for example
whsec_…ab12, last 4 characters visible) so you can identify it without exposing it. - If a secret leaks, rotate it. The old secret stops verifying deliveries immediately, so update your integration in lockstep.
The event envelope
Every delivery is a JSON body with this shape:Headers
Each delivery carries these headers:Verifying the signature
TheX-Vouchmark-Signature header has the form t=<unixSeconds>,v1=<hmacHex>, where t matches X-Vouchmark-Timestamp.
To verify a delivery:
-
Read
tandv1from theX-Vouchmark-Signatureheader. -
Build the signed payload by concatenating the timestamp, a
., and the exact raw request body (the bytes you received, before any JSON re-serialization): -
Compute
HMAC-SHA256(signedPayload, signingSecret)and encode it as lowercase hex. -
Compare your computed value against
v1in constant time. -
Reject deliveries whose
tis too far in the past to protect against replay attacks.
Node.js example
express.raw({ type: "application/json" }) (or express.json({ verify })) so rawBody is the unparsed string.
Event types
A webhook only receives events for its subscribedserviceType and environment. The event types currently emitted are:
Service types
Sandbox vs live
sandbox and live are fully separate. Register a webhook per environment, and remember that each environment has its own signing secret. Test against sandbox before pointing live traffic at your production endpoint.
Reliability and retries
- Deliveries are at-least-once. The same event may arrive more than once, so dedupe on the delivery
id(thewhd_...value, also inX-Vouchmark-Delivery). - Vouchmark attempts each delivery up to 5 times with exponential backoff (base 5 seconds).
- Each attempt has a 10 second request timeout.
- Respond with a
2xxstatus quickly and process the event asynchronously. Any non-2xxresponse or a timeout triggers a retry.
Register an endpoint
Response
signingSecret is returned in full here only — store it now.
List your endpoints
signingSecretMasked, never in full.
Rotate a signing secret
signingSecret. The previous secret stops verifying deliveries immediately. See Rotate webhook secret.
