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.

NameTypeDescription
pickupDatestring (YYYY-MM-DD)Start date of the booking. Time is selected later based on availability and schedule.
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. Optionally pass a config object. The config supports the same keys as the URL parameters above.
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.

Listening to events

Events are dispatched on window. To show the form as soon as it loads:

window.addEventListener('lb-ready', function () {
LetsBook.show();
});

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.