Skip to main content

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.

NameTypeDescription
requestedPickupDatestring (YYYY-MM-DD)First day of the date range to show options for. Use together with requestedReturnDate.
requestedReturnDatestring (YYYY-MM-DD)Last day of the date range to show options for (inclusive). Use together with requestedPickupDate.
pickupDatestring (YYYY-MM-DD)Date of one specific option to preselect. Shows no options unless requestedPickupDate and requestedReturnDate are also passed. Rarely needed.
dockIdstring (UUID)Dock ID (Dock settings > Show ID).
boatModelIdstring (UUID)Boat model ID (Inventory > Boats > [Boat model] > Show ID).
numberOfBoatsintegerNumber of boats to preselect. If not available, the form will show an error later in the flow.
numberOfPassengersintegerNumber of passengers (if enabled).
couponCodestringCoupon code to prefill. It will be validated.
partnerCodestringTracks bookings made through partner or referral sites.
showCouponFormboolean (1 or 0)Show the coupon code form immediately on open.
showLoginFormboolean (1 or 0)Show the login panel on open.
forceLoginboolean (1 or 0)Require login before any interaction. Useful for memberships.
filterDocksstring (comma separated UUIDs)Restrict visible docks. Find IDs in Dock detail > Show ID.
filterBoatModelsstring (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 nameDescription
show(config): voidShow the booking form. Pass a config object to say which booking form to open (see below).
hide(): voidHide the booking form.
destroy(): () => voidRemove 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:

NameTypeDescription
organizationSlugstringRequired. Your organization slug: the first part of your booking form URL (<your-slug> in the example above).
localestringThe 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 typeDescription
lb-readyThe booking form loaded and LetsBook is available.
lb-showThe booking form is shown. The id is available on event.detail.
lb-hideThe booking form is hidden. The id is available on event.detail.
lb-navigateThe user navigates within the form. Use it to forward data to your analytics tool.
lb-payment-methodThe user chose a payment method.
lb-completeThe user completed the booking.