BookingHub Platform · Developers

Partner API & Embed reference

Everything a travel business needs to integrate with BookingHub: pull your referral, booking and commission reports into your own systems, embed the travel budget planner, and attribute every referral to your partner ID.

Version v1Base URL https://bookinghub.website/wp-json/bookinghub/v1Format JSON over HTTPSStatus Stable

Overview

The BookingHub Partner API has two parts:

Reports APIRead-only JSON reports: referrals, destinations, campaigns, bookings and commission, plus integration status and your access log.
Embed widgetA two-line snippet that puts the BookingHub travel budget planner on your website and labels every referral with your partner ID.
AttributionReferrals from your embeds carry your partner ID, so bookings and commission can be credited to you.
Privacy by designThe API only returns aggregated figures. BookingHub does not store, and the API never returns, travellers' names, contact details, IP addresses or payment data.

Quick start

  1. Get a key. Email info@bookinghub.website. You receive a partner ID (for embeds) and a private access key (for reports).
  2. Call the report endpoint from your server with the key in the X-BH-Key header.
  3. 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"

Authentication

Every request is authenticated with a private access key sent in the X-BH-Key request header.

Key typeOpensIssued to
Partner keyYour own figures onlyEach travel brand / partner
Administrator keyAll partners, the network and the full access logBookingHub staff only
Call the API from your server, not from a web pageTreat the key like a password: store it in an environment variable or secret manager and never put it in browser code, a mobile app or a public repository. Browsers on other websites can't send the 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

ControlValue
Requests per network address120 per hour
Failed keys before lock-out10 per hour — the network address is then blocked for one hour
TransportHTTPS only (TLS); responses are sent with Cache-Control: private, no-store
Audit logEvery request is logged (time, key holder, accepted/refused, method) and returned to you in access_log
Key rotationKeys 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

GET/wp-json/bookinghub/v1/partner-report

Returns referrals, destinations, campaigns, traffic sources, devices, bookings and commission for the period, plus integration status and your recent access history.

Query parameters

ParameterTypeDescription
daysintegeroptionalReport 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

HeaderDescription
X-BH-KeyrequiredYour access key.

Example response (illustrative values)

200 OK · application/json
{
  "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

FieldTypeDescription
partnerstringThe partner the key belongs to, or "All partners" for the administrator key.
rolestringpartner or admin.
days, from, toint, date, dateThe period covered (UTC dates, inclusive).
generatedISO 8601When this report was built.
totals.clicksintReferrals (clicks on your partner links) in the period.
totals.prev_clicksintReferrals in the previous period of the same length.
totals.views_on_linking_pagesintPage views on the pages that sent you referrals.
totals.site_viewsintAll BookingHub page views in the period.
daily[]arrayOne entry per day: date, clicks.
destinations[]arrayTop 12 destinations: name (city and airport code), clicks.
campaigns[]arrayTop 20 link labels (sub IDs): name, clicks and, when the network reports them, bookings. Embed referrals start with p_<partner-id>.
pages[]arrayPages that sent referrals: page, clicks, views.
sources[], devices[]arrayReferrals by traffic source (e.g. google, direct) and device (mobile, tablet, desktop).
partners[]arrayAdministrator key only: referrals per partner.
conversions.bookingsintConfirmed + pending bookings in months overlapping the period.
conversions.revenueobjectConfirmed + pending commission, keyed by currency.
conversions.months[]arrayPer month and partner: paid (confirmed), pending, cancelled counts; booking_value; commission_confirmed, commission_pending, commission_cancelled; currency; source.
integrations[]arrayEach data source: name, status (ok, stale, failed, not_connected), last successful sync, detail.
last_syncISO 8601 | nullMost recent successful sync across integrations.
access_log[]arrayUp to 20 recent requests with your key: at, who, ok, note (header or link).
tracking_sincedateWhen 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.

StatusMeaningPayable?
pendingBooked through a BookingHub referral; the trip or stay hasn't happened yet.Not yet
paid / confirmedThe partner confirmed the trip took place.Yes — in the next payout
cancelledCancelled 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.

HTTPBodyWhat to do
200Report 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.

GET /wp-json/bookinghub/v1/partner-report?days=30 X-BH-Key: •••••••• ← The response will appear here.
Ready.

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.

HTML
<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>
AttributeValues
data-partnerrecommendedYour partner ID — letters and numbers, up to 24 characters. Without it, referrals aren't credited to you.
data-tooloptionalbudget-planner (default) or trip-cost.
data-tooptionalDefault destination, 3-letter airport/city code (e.g. DXB, IST, LON). 272 destinations supported.
data-fromoptionalDefault departure, 3-letter code (e.g. KWI). 280 departure cities supported.
data-currencyoptionalISO 4217 code (e.g. USD, EUR, KWD). 153 currencies; default follows the visitor's country.
data-daysoptionalTrip 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/:

ParameterValues
embed1 hides BookingHub's menu and footer and opens booking links in a new tab.
partnerYour partner ID (attribution).
toDestination code, e.g. DXB.
fromDeparture code, e.g. KWI.
daysTrip length (same values as data-days).
nTravellers: 1–10, 12, 15, 20, 25, 30.
stylebackpacker, budget, mid, comfort, luxury.
curCurrency code, e.g. EUR.
budgetTotal budget in the chosen currency (whole number).
Example link
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:

JavaScript
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 typeLabel addedAppears in your report as
Flightsmarker=582556.p_<partner-id>campaigns[].name = "p_<partner-id>"
Hotelssub_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.

FeatureStatus
Booking-level ledger (one row per booking with reference)Planned
Webhooks for new and status-changed bookingsPlanned
Payout and invoice recordsPlanned
Individual user accounts with two-step sign-in (replacing shared keys)Planned
CSV / scheduled email exportsPlanned

Changelog

DateChange
26 Nov 2026Key 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 2026Embed widget and embed mode for the travel budget planner with partner attribution.
25 Nov 2026Partner 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

© 2026 BookingHub. All rights reserved. Unauthorized copying, scraping or reproduction of this site or its tools is prohibited. · Terms of Use · Privacy