Overview
The BookingHub Partner API has two parts:
Quick start
- Get a key. Email info@bookinghub.website. You receive a partner ID (for embeds) and a private access key (for reports).
- Call the report endpoint from your server with the key in the
X-BH-Keyheader. - Embed the planner on your site with your partner ID, and watch referrals arrive in your report and in the partner dashboard.
curl https://bookinghub.website/wp-json/bookinghub/v1/partner-report?days=30 \ -H "X-BH-Key: $BOOKINGHUB_KEY"
// Node.js 18+ (built-in fetch). Keep the key in an environment variable. const res = await fetch('https://bookinghub.website/wp-json/bookinghub/v1/partner-report?days=30', { headers: { 'X-BH-Key': process.env.BOOKINGHUB_KEY } }); if (!res.ok) throw new Error((await res.json()).error); const report = await res.json(); console.log(report.totals.clicks, 'referrals');
import os, requests r = requests.get( "https://bookinghub.website/wp-json/bookinghub/v1/partner-report", params={"days": 30}, headers={"X-BH-Key": os.environ["BOOKINGHUB_KEY"]}, timeout=30, ) r.raise_for_status() report = r.json() print(report["totals"]["clicks"], "referrals")
<?php $ch = curl_init('https://bookinghub.website/wp-json/bookinghub/v1/partner-report?days=30'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['X-BH-Key: ' . getenv('BOOKINGHUB_KEY')], CURLOPT_TIMEOUT => 30, ]); $report = json_decode(curl_exec($ch), true); echo $report['totals']['clicks'] . " referrals\n";
Authentication
Every request is authenticated with a private access key sent in the X-BH-Key request header.
| Key type | Opens | Issued to |
|---|---|---|
| Partner key | Your own figures only | Each travel brand / partner |
| Administrator key | All partners, the network and the full access log | BookingHub staff only |
X-BH-Key header to BookingHub (cross-origin requests don't allow it), which keeps keys out of the front end.Older report links that pass the key as ?key= still work for compatibility, but they can leak through browser history and server logs. Use the header for all new integrations.
Rate limits & security
| Control | Value |
|---|---|
| Requests per network address | 120 per hour |
| Failed keys before lock-out | 10 per hour — the network address is then blocked for one hour |
| Transport | HTTPS only (TLS); responses are sent with Cache-Control: private, no-store |
| Audit log | Every request is logged (time, key holder, accepted/refused, method) and returned to you in access_log |
| Key rotation | Keys can be switched off or replaced at any time — email us |
Reports refresh as data arrives: click tracking is real-time, booking and commission data is imported from the affiliate network once a day. Polling more than once an hour brings no new data.
Get partner report LIVE
/wp-json/bookinghub/v1/partner-reportReturns referrals, destinations, campaigns, traffic sources, devices, bookings and commission for the period, plus integration status and your recent access history.
Query parameters
| Parameter | Type | Description | |
|---|---|---|---|
days | integer | optional | Report period ending today: 7, 30, 90 or 365. Any other value uses 30. The previous period of the same length is used for prev_clicks. |
Headers
| Header | Description | |
|---|---|---|
X-BH-Key | required | Your access key. |
Example response (illustrative values)
{
"partner": "Trip.com",
"all": false,
"role": "partner",
"days": 30,
"from": "2026-10-28",
"to": "2026-11-26",
"generated": "2026-11-26T12:00:00+00:00",
"totals": { "clicks": 412, "prev_clicks": 350, "views_on_linking_pages": 5210, "site_views": 18340 },
"daily": [ { "date": "2026-11-25", "clicks": 17 } ],
"destinations": [ { "name": "Dubai (DXB)", "clicks": 96 } ],
"campaigns": [ { "name": "p_seaviewhotel_dxb", "clicks": 31, "bookings": 2 } ],
"pages": [ { "page": "/dubai-travel-guide/", "clicks": 58, "views": 940 } ],
"sources": [ { "name": "google", "clicks": 201 } ],
"devices": [ { "name": "mobile", "clicks": 288 } ],
"partners": [],
"conversions": {
"bookings": 9,
"revenue": { "USD": 214.60 },
"auto": true,
"months": [ {
"month": "2026-11", "partner": "Trip.com",
"bookings": 9, "paid": 5, "pending": 4, "cancelled": 1,
"booking_value": 4290.00,
"commission_confirmed": 121.10, "commission_pending": 93.50, "commission_cancelled": 18.20,
"revenue": 214.60, "currency": "USD", "source": "Travelpayouts (automatic)"
} ]
},
"integrations": [
{ "name": "Click & page-view tracking", "status": "ok", "last": "2026-11-26T11:58:00+00:00", "detail": "First-party, no cookies." },
{ "name": "Travelpayouts bookings & commissions", "status": "ok", "last": "2026-11-26T03:10:00+00:00", "detail": "Imported daily." },
{ "name": "Payouts & invoices", "status": "not_connected", "last": null, "detail": "Payouts are made by the affiliate network and are not imported yet." }
],
"last_sync": "2026-11-26T11:58:00+00:00",
"access_log": [ { "at": "2026-11-26T12:00:00+00:00", "who": "Trip.com", "ok": true, "note": "header" } ],
"tracking_since": "2026-11-25"
}Response fields
| Field | Type | Description |
|---|---|---|
partner | string | The partner the key belongs to, or "All partners" for the administrator key. |
role | string | partner or admin. |
days, from, to | int, date, date | The period covered (UTC dates, inclusive). |
generated | ISO 8601 | When this report was built. |
totals.clicks | int | Referrals (clicks on your partner links) in the period. |
totals.prev_clicks | int | Referrals in the previous period of the same length. |
totals.views_on_linking_pages | int | Page views on the pages that sent you referrals. |
totals.site_views | int | All BookingHub page views in the period. |
daily[] | array | One entry per day: date, clicks. |
destinations[] | array | Top 12 destinations: name (city and airport code), clicks. |
campaigns[] | array | Top 20 link labels (sub IDs): name, clicks and, when the network reports them, bookings. Embed referrals start with p_<partner-id>. |
pages[] | array | Pages that sent referrals: page, clicks, views. |
sources[], devices[] | array | Referrals by traffic source (e.g. google, direct) and device (mobile, tablet, desktop). |
partners[] | array | Administrator key only: referrals per partner. |
conversions.bookings | int | Confirmed + pending bookings in months overlapping the period. |
conversions.revenue | object | Confirmed + pending commission, keyed by currency. |
conversions.months[] | array | Per month and partner: paid (confirmed), pending, cancelled counts; booking_value; commission_confirmed, commission_pending, commission_cancelled; currency; source. |
integrations[] | array | Each data source: name, status (ok, stale, failed, not_connected), last successful sync, detail. |
last_sync | ISO 8601 | null | Most recent successful sync across integrations. |
access_log[] | array | Up to 20 recent requests with your key: at, who, ok, note (header or link). |
tracking_since | date | When BookingHub's first-party measurement started. |
Fields may be added in future versions; ignore fields you don't recognise. Existing fields won't be removed or renamed within v1.
Booking statuses & commission
Commission = booking value × the partner programme's commission rate, as reported by the affiliate network.
| Status | Meaning | Payable? |
|---|---|---|
| pending | Booked through a BookingHub referral; the trip or stay hasn't happened yet. | Not yet |
| paid / confirmed | The partner confirmed the trip took place. | Yes — in the next payout |
| cancelled | Cancelled before travel, or reversed after confirmation. | No — removed |
Bookings can change status for several weeks, so the last three months are re-imported every day.
Errors
Errors return a JSON body with an error message.
| HTTP | Body | What to do |
|---|---|---|
200 | Report JSON | — |
403 | {"error":"This key is not valid or has been switched off."} | Check the key; ask us for a new one if it was rotated. |
429 | {"error":"Too many attempts. Try again in an hour."} | Slow down. Back off for one hour after repeated failures. |
5xx | — | Temporary problem. Retry with exponential back-off. |
Try it
Send a real request with your key. It runs in this page on bookinghub.website, is not stored, and appears in your access log.
Embed widget LIVE
Paste this on any page. The widget loads the BookingHub travel budget planner in a secure frame, sizes it automatically and labels every referral with your partner ID. Build a snippet visually in the embed builder.
<div class="bookinghub-widget" data-tool="budget-planner" data-partner="seaviewhotel" data-to="DXB" data-from="KWI" data-currency="KWD" data-days="7"></div> <script src="https://bookinghub.website/embed/bh-widget.js" async></script>
| Attribute | Values | |
|---|---|---|
data-partner | recommended | Your partner ID — letters and numbers, up to 24 characters. Without it, referrals aren't credited to you. |
data-tool | optional | budget-planner (default) or trip-cost. |
data-to | optional | Default destination, 3-letter airport/city code (e.g. DXB, IST, LON). 272 destinations supported. |
data-from | optional | Default departure, 3-letter code (e.g. KWI). 280 departure cities supported. |
data-currency | optional | ISO 4217 code (e.g. USD, EUR, KWD). 153 currencies; default follows the visitor's country. |
data-days | optional | Trip length: 1–30, 35, 42, 45, 60, 75 or 90. Default 7. |
You can place several widgets on one page; each .bookinghub-widget element (or element with data-bookinghub-tool) is mounted once.
Planner URL
To link to the planner instead of embedding it — or to embed it with your own <iframe> — use these parameters on https://bookinghub.website/travel-budget-planner/:
| Parameter | Values |
|---|---|
embed | 1 hides BookingHub's menu and footer and opens booking links in a new tab. |
partner | Your partner ID (attribution). |
to | Destination code, e.g. DXB. |
from | Departure code, e.g. KWI. |
days | Trip length (same values as data-days). |
n | Travellers: 1–10, 12, 15, 20, 25, 30. |
style | backpacker, budget, mid, comfort, luxury. |
cur | Currency code, e.g. EUR. |
budget | Total budget in the chosen currency (whole number). |
https://bookinghub.website/travel-budget-planner/?partner=seaviewhotel&to=DXB&from=KWI&days=5&n=2&style=comfort&cur=KWD
Resize events
The embedded planner tells its parent page how tall it is, so the widget can resize without scrollbars. If you use your own <iframe>, listen for the message — and always check the origin:
window.addEventListener('message', (e) => { if (e.origin !== 'https://bookinghub.website') return; if (e.data && e.data.bhEmbedHeight) { document.getElementById('bh-frame').style.height = e.data.bhEmbedHeight + 'px'; } }); // message shape: { bhEmbedHeight: 2140, bhTool: "budget-planner" }
Attribution
When a visitor clicks a booking link inside an embed carrying your partner ID, BookingHub labels the referral before it leaves for the booking partner:
| Link type | Label added | Appears in your report as |
|---|---|---|
| Flights | marker=582556.p_<partner-id> | campaigns[].name = "p_<partner-id>" |
| Hotels | sub_id=p_<partner-id>_<destination> | campaigns[].name = "p_<partner-id>_dxb" |
Bookings reported by the network are matched to these labels, so you can see which of your placements produced bookings. Commission-sharing terms for embed partners are agreed individually.
Roadmap
Planned — not available yet. Tell us which you need first.
| Feature | Status |
|---|---|
| Booking-level ledger (one row per booking with reference) | Planned |
| Webhooks for new and status-changed bookings | Planned |
| Payout and invoice records | Planned |
| Individual user accounts with two-step sign-in (replacing shared keys) | Planned |
| CSV / scheduled email exports | Planned |
Changelog
| Date | Change |
|---|---|
| 26 Nov 2026 | Key accepted in the X-BH-Key header; failed-key lock-out; access log, integration status and last_sync added; confirmed / pending / cancelled commission and booking value per month. |
| 26 Nov 2026 | Embed widget and embed mode for the travel budget planner with partner attribution. |
| 25 Nov 2026 | Partner report endpoint launched with referrals, destinations, campaigns and automatic Travelpayouts conversions. |
Support
Keys, partner IDs, rotated credentials and integration questions: info@bookinghub.website. Please never email your key in full — the first and last four characters are enough for us to identify it.
See also: Platform overview · Partner dashboard · Privacy policy · Terms