How to set up TBBN webhooks
A webhook is a URL on your server that TBBN calls the moment something happens — an offer is accepted, a trade completes, a Space booking is paid. Use it to keep your own system in sync without polling the API.
There are two kinds:
| Webhook | Events | Set up on |
|---|---|---|
| Merchant webhooks | One Merchant's offers, trades, checkouts and listings | merchants.tbbnetwork.com → Webhooks |
| Business webhooks | Your Space bookings — and, if you choose, every one of your Merchants' events | business.tbbnetwork.com → your Business → Webhooks |
Which one do I need?
- One Merchant, nothing else: a Merchant webhook.
- More than one Merchant, or Merchants and Spaces: one Business webhook with Also send my Merchants’ trade, offer, listing and checkout events ticked. It covers every Merchant you run, including ones you link later, at one address with one signing secret. Change it once and the change applies everywhere — you don't need a webhook on each Merchant.
- Several systems (say, an order system and a front desk): add one webhook for each and give each its own Name.
If the same address is set up on a Merchant and on your Business, you still get each event once.
Before you start
You need a public HTTPS URL on your server (not localhost or a private network address) that:
- accepts
POSTrequests with a JSON body, - answers with any
2xxstatus within a few seconds (do slow work afterwards), - checks the signature on every request (below).
Add a Merchant webhook
- Sign in at merchants.tbbnetwork.com and select Webhooks.
- Under Add a webhook, give it a name (for example Order system) and enter your endpoint's
URL, for example
https://yourapp.com/webhooks/tbbn. - Choose events: Everything, or untick it and pick the ones you want, such as Offer accepted, Trade completed or Checkout paid.
- Select Add webhook. On a live account TBBN emails you a code and asks for it under Confirm
it’s you. The webhook then appears in the list with its Signing secret (
whsec_…). Store it on your server.
The full list of events, and how to subscribe to others through the API, is in Webhooks & events.
Add a Business webhook
You need the Admin or Developer role on the Business.
- Go to business.tbbnetwork.com and open your Business.
- Under Webhooks, give it a name and enter your endpoint's URL.
- To receive your Merchants' events here too, tick Also send my Merchants’ trade, offer, listing and checkout events.
- Choose events: Everything, or untick it and pick from Space bookings (and Merchant events, if you ticked step 3).
- Select Add webhook and enter the code TBBN emails you. Copy its Signing secret.
Events from your Merchants carry merchantIds, so your system knows which Merchant each one is
about.
Change a webhook
Select Edit next to it, change its name, URL or events, and select Save changes. The signing secret stays the same, so your server needs no change.
Change a signing secret
If a secret may have leaked, select New secret next to the webhook, confirm the prompt and enter the code TBBN emails you. The new secret shows in the list straight away. For the next 24 hours each delivery is signed with both secrets, so change your server over within that time and you won't miss anything.
Check every delivery is really from TBBN
Each request has a header:
X-TBBN-Signature: t=1767225600,v1=5f2c…
To verify it:
- Read
t(a Unix timestamp) andv1(a hex signature) from the header. - Compute an HMAC-SHA256 of
t, a dot, and the raw request body —${t}.${rawBody}— using your endpoint's signing secret. - Compare it with
v1using a constant-time comparison. For 24 hours after a secret changes the header has twov1values, one per secret, and matching either is enough. - Reject the request if they don't match, or if
tis more than 5 minutes old.
Every TBBN SDK includes verifyWebhookSignature(), which does all of this — see
SDKs.
If your endpoint is down
TBBN retries: three quick attempts, then after 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours.
After that the delivery is set aside so you can replay it. The same event can arrive more than once —
use its deliveryId to ignore duplicates. Details are in
Webhooks & events.
Turn a webhook off
Select Disable next to it. TBBN stops sending to it immediately.
Common questions
I'm not receiving anything. Check the URL is public HTTPS (not localhost) and returns 2xx.
For local testing, use a tunnelling tool that gives your machine a public URL.
Signatures never match. Make sure you sign the raw body exactly as received — not re-encoded JSON — and that you're using the secret for that specific endpoint.
Do webhooks use my API key? No. Each endpoint has its own signing secret.
Still stuck? Ask in the community or contact us from tbbnetwork.com/contact.
