Your endpoint must respond with a 2xx status within 10 seconds. Process heavy work asynchronously after acknowledging receipt.
Webhooks
Receive real-time event notifications from OFFER-HUB via HTTP webhooks.
Overview
Webhooks let your application receive real-time notifications when events occur in OFFER-HUB — escrow lifecycle changes, balance updates, order state changes, and more. You register an HTTP endpoint; OFFER-HUB sends a POST request with a JSON payload and an X-OfferHub-Signature header so you can verify authenticity.
Configuring a Webhook Endpoint
Register a webhook by creating a subscription with your URL, the events you want, and a signing secret.
POST /api/v1/webhooks
Request body:
A successful response returns the webhook object with its id:
Event Types
OFFER-HUB emits the following webhook events. Subscribe only to the ones your integration needs.
| Event | Trigger |
|---|---|
escrow.created | New escrow contract created |
escrow.funded | Escrow has received on-chain funds |
escrow.released | Seller paid; escrow completed |
escrow.disputed | Dispute opened on an escrow |
escrow.refunded | Escrow refunded to buyer |
Payload Structure
All webhook events share a common envelope: id, type, created_at, and data. The data object varies by event type.
Common envelope
escrow.created
Emitted when a new escrow is created.
escrow.funded
Emitted when the escrow has received funds on-chain.
escrow.released
Emitted when the escrow is released and the seller is paid.
escrow.disputed
Emitted when a dispute is opened on the escrow.
escrow.refunded
Emitted when the escrow is refunded to the buyer.
Signature Verification
Every webhook request includes an X-OfferHub-Signature header. Verify it using your webhook secret and the raw request body to ensure the payload came from OFFER-HUB and was not modified.
The signature is the HMAC SHA-256 of the raw body, prefixed with sha256=.
Always verify the signature before processing a webhook payload. Skipping this step exposes your application to spoofed events.
Use the raw request body (string or buffer) for verification, not the parsed JSON. Re-serializing the body can change formatting and break the signature.
Retry Logic
OFFER-HUB retries failed webhook deliveries with exponential back-off. A delivery is considered failed if your endpoint returns a non-2xx status or does not respond within 10 seconds.
| Attempt | Delay after previous attempt |
|---|---|
| 1st retry | 30 seconds |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 24 hours |
After 5 failed attempts the webhook subscription is disabled. Re-enable it from your dashboard or by re-registering the endpoint.
Return 200 or 204 as soon as you have received and validated the payload. Queue or process the event asynchronously to stay within the 10-second timeout.
Testing Locally
Your development server is not reachable from the internet. Use a tunnel to expose it so OFFER-HUB can deliver webhooks.
Using a tunnel
npx localtunnel --port 3000Use the provided URL (e.g. https://random-subdomain.loca.lt) as your webhook URL when registering:
Alternative tools
- ngrok —
ngrok http 3000 - Cloudflare Tunnel — for a stable hostname
Use the same signing secret in development as in your tunnel config so you can verify signatures locally.