<aside> 📌
This guide is for external partners integrating the Booker Card Capture Widget into their own web application. It covers the client beacon API, the authentication flow, the event contract, and how to validate your integration using the built-in Debug page.
</aside>
The Card Capture Widget is an embeddable, PCI-conscious UI for capturing and managing customer credit cards. It runs inside an iframe hosted on a Booker domain, so raw card data never touches the partner's page or servers.
Communication between the partner page and the widget iframe happens over window.postMessage, wrapped by a small loader script called the client beacon (cc-widget-client.js).
sequenceDiagram
participant P as "Partner Page"
participant B as "cc-widget-client.js"
participant W as "Widget iframe (Booker)"
participant API as "Booker Identity + API"
P->>B: loadWidget(getClientToken, onEvent, locationId, customerId, locale)
B->>W: create iframe, wait for reactAppReady
B->>P: calls getClientToken()
P->>API: exchange credentials for widget token
API-->>P: AccessToken
P-->>B: Promise resolves with token
B->>W: postMessage renewTokenComplete + token
B->>W: postMessage setupClient + showPartnerWidget
W-->>B: postMessage event (Loaded / Success / Error ...)
B->>P: onEvent(payload)
<aside> 🔒
Key security property: the partner never handles PAN data. The card form is rendered by the Booker-hosted iframe and submitted directly to Booker services.
</aside>
Before you start, Booker will provide you with:
| Item | Description |
|---|---|
client_id |
Your OAuth client identifier |
client_secret |
Your OAuth client secret. Server-side only — never expose in browser code |
personal_access_token (PAT) |
Long-lived token identifying your partner account. Server-side only |
locationId |
The Booker location (also called SPA ID) the card is being captured for |
customerId |
The Booker customer the card will be attached to |
Add the client beacon near the end of your <body>:
<script src="https://ccwidget.secure-booker.com/cc-widget-client.js"></script>