The basics
1
Something happens
A payment moves to a new step. For example, your customer’s money arrives.
2
We send a message
We send a
POST request to your URL with a JSON body describing what happened. This is called an event.3
You reply
Your server replies with any
2xx status code, such as 200, within 10 seconds. That tells us you got it.4
You act on it
Update your database, notify your customer, and so on.
What a webhook looks like
Headers
Body
Order of events
For each payment, we send events one at a time, in order. We don’t sendfiat_pending until you’ve accepted initiated. If one delivery is being retried, the next events for that payment wait for it.
See the full event timeline.
Retries
If your server doesn’t reply with2xx within 10 seconds, or can’t be reached, we try again. We make up to 5 attempts:
Each retry can be up to 15 seconds later than shown. After 5 failed attempts, we stop. You can see every attempt in the Bridge app under Webhooks, in the endpoint’s delivery list.
Redirects (
3xx) count as a failure. Make sure your URL is the final one.Best practices
Expect duplicates
Expect duplicates
You might receive the same event more than once, for example if your reply was lost. Save each
id (wbd_…) you’ve handled and skip ones you’ve seen.Always verify the signature
Always verify the signature
Anyone can send a request to your URL. Check
X-Webhook-Signature before trusting it. See Verify webhooks.Use status for decisions
Use status for decisions
Decide success or failure from
data.status. Use data.state to show progress.Have a backup
Have a backup
If your server was down for a long time, call List payments to catch up on anything you missed.
Test events
From the Bridge app you can send atest.webhook.ping event to check your URL works. See Send a test message.
