Advanced website integration
Need more control over the embed? This short guide is for developers.
When you use the embed script, any link that points to your booking form URL opens the form over your site. Example:
<a href="https://<your-slug>.letsbook.app/en-us/form">Book now</a>
URL parameters
Pass URL parameters to prefill and filter the form. To preselect dates, pass requestedPickupDate and requestedReturnDate.
| Name | Type | Description |
|---|---|---|
requestedPickupDate | string (YYYY-MM-DD) | First day of the date range to show options for. Use together with requestedReturnDate. |
requestedReturnDate | string (YYYY-MM-DD) | Last day of the date range to show options for (inclusive). Use together with requestedPickupDate. |
pickupDate | string (YYYY-MM-DD) | Date of one specific option to preselect. Shows no options unless requestedPickupDate and requestedReturnDate are also passed. Rarely needed. |
dockId | string (UUID) | Dock ID (Dock settings > Show ID). |
boatModelId | string (UUID) | Boat model ID (Inventory > Boats > [Boat model] > Show ID). |
numberOfBoats | integer | Number of boats to preselect. If not available, the form will show an error later in the flow. |
numberOfPassengers | integer | Number of passengers (if enabled). |
couponCode | string | Coupon code to prefill. It will be validated. |
partnerCode | string | Tracks bookings made through partner or referral sites. |
showCouponForm | boolean (1 or 0) | Show the coupon code form immediately on open. |
showLoginForm | boolean (1 or 0) | Show the login panel on open. |
forceLogin | boolean (1 or 0) | Require login before any interaction. Useful for memberships. |
filterDocks | string (comma separated UUIDs) | Restrict visible docks. Find IDs in Dock detail > Show ID. |
filterBoatModels | string (comma separated UUIDs) | Restrict visible boat models. Find IDs in Boat model detail > Show ID. |
JavaScript control
Use JavaScript for advanced control. The API is exposed via a global LetsBook after the lb-ready event fires.
Methods
| Method name | Description |
|---|---|
show(config): void | Show the booking form. Pass a config object to say which booking form to open (see below). |
hide(): void | Hide the booking form. |
destroy(): () => void | Remove the booking form embed and the LetsBook global. The returned function can be called to reinitialize the booking form embed when needed. |
Config for show()
A link has your organization slug and language in its URL. show() has no link to read them from, so pass them in the config:
| Name | Type | Description |
|---|---|---|
organizationSlug | string | Required. Your organization slug: the first part of your booking form URL (<your-slug> in the example above). |
locale | string | The language of the form, as in your booking form URL (for example en-us). Defaults to your default language. |
Without organizationSlug nothing opens, and the browser console shows an error.
The config also supports the same keys as the URL parameters above. Write booleans as 1 or 0, like in a URL:
LetsBook.show({
organizationSlug: '<your-slug>',
locale: 'en-us',
pickupDate: '2026-07-01',
showCouponForm: 1,
});
Listening to events
Events are dispatched on window. To show the form as soon as it loads:
window.addEventListener('lb-ready', function () {
LetsBook.show({ organizationSlug: '<your-slug>', locale: 'en-us' });
});
Event types
| Event type | Description |
|---|---|
lb-ready | The booking form loaded and LetsBook is available. |
lb-show | The booking form is shown. The id is available on event.detail. |
lb-hide | The booking form is hidden. The id is available on event.detail. |
lb-navigate | The user navigates within the form. Use it to forward data to your analytics tool. |
lb-payment-method | The user chose a payment method. |
lb-complete | The user completed the booking. |