JavaScript API
Call Hosted Package methods after the script loads and send custom analytics events.
Call Hosted Package methods after the script loads and send custom analytics events. First, complete the installation.
JavaScript API
Use window.Tiquo.ready when you want to call the API after the script loads.
<script>
window.Tiquo.ready(function (tiquo) {
tiquo.track("booking_started", {
eventName: "Booking Started",
eventProperties: {
source: "homepage"
}
});
});
</script>Available methods:
Tiquo.ready(callback)Tiquo.track(eventType, options)Tiquo.identify(options)Tiquo.sendOTP(email)Tiquo.verifyOTP(email, code)Tiquo.getUser()Tiquo.updateProfile(updates)Tiquo.subscribeToMarketing(input): public email/SMS signup without loginTiquo.createEnquiry(input)Tiquo.uploadProfilePhoto(photo)Tiquo.logout()Tiquo.getOrders(options)Tiquo.getBookings(options)Tiquo.cancelBooking(bookingId)Tiquo.getBookingRescheduleOptions(bookingId, options)Tiquo.rescheduleBooking(bookingId, data)Tiquo.getMemberships()Tiquo.getGuestFlows(options): pass{ refresh: true }to bypass the session cacheTiquo.getGuestFlow(flowId)Tiquo.createGuestInvitations(input)Tiquo.getGuestInvitation(token)Tiquo.acceptGuestInvitation(token)Tiquo.getGuestPasses(): lists Guest Pass invitationsTiquo.getPassBalances(): counts Access Passes and Guest PassesTiquo.getWalletCardLinks(options)Tiquo.getUpcomingBookings(options)Tiquo.getPolicies()Tiquo.getPolicy(id)Tiquo.getFlowServices(bookingConfigId)Tiquo.getFlowAvailability(bookingConfigId, options)Tiquo.getFlowService(bookingConfigId, serviceId)Tiquo.getIframeToken(customerFlowId, handoffVersion)Tiquo.embedCustomerFlow(flowUrl, container, options): supports category-locked booking URLsTiquo.embedServiceBooking(bookingConfigId, serviceId, container, options)Tiquo.embedMembership(planId, container, options)Tiquo.embedCardForm(container, options)Tiquo.embedPaymentMethods(container, options)Tiquo.getPaymentMethods()Tiquo.setDefaultPaymentMethod(paymentMethodId)Tiquo.removePaymentMethod(paymentMethodId)Tiquo.render()Tiquo.onAuthStateChange(callback)Tiquo.setConsent(mode)Tiquo.getConsent()
Hosted Package JavaScript API
Inspect every public method, grouped by authentication, customer data, catalogs, embeds, analytics, rendering, and consent.
window.Tiquo
Complete public method set
Every available JavaScript method
27 fieldsRun after load
Tiquo.ready(callback)
Track an event
Tiquo.track(eventType, options)
Identify a customer
Tiquo.identify(options)
Send a one-time code
Tiquo.sendOTP(email)
Verify a one-time code
Tiquo.verifyOTP(email, code)
Get the current customer
Tiquo.getUser()
Log out
Tiquo.logout()
Get orders
Tiquo.getOrders(options)
Get bookings
Tiquo.getBookings(options)
Cancel a booking
Tiquo.cancelBooking(bookingId)
Get reschedule options
Tiquo.getBookingRescheduleOptions(bookingId, options)
Reschedule a booking
Tiquo.rescheduleBooking(bookingId, data)
Get memberships
Tiquo.getMemberships()
Get upcoming bookings
Tiquo.getUpcomingBookings(options)
Get business policies
Tiquo.getPolicies()
Get one business policy
Tiquo.getPolicy(id)
Get flow services
Tiquo.getFlowServices(bookingConfigId)
Get calendar availability
Tiquo.getFlowAvailability(bookingConfigId, options)
Get one flow service
Tiquo.getFlowService(bookingConfigId, serviceId)
Get an iframe token
Tiquo.getIframeToken(customerFlowId, handoffVersion)
Embed a customer flow
Tiquo.embedCustomerFlow(flowUrl, container, options)
Embed a service booking
Tiquo.embedServiceBooking(bookingConfigId, serviceId, container, options)
Embed a membership
Tiquo.embedMembership(planId, container, options)
Render bound elements
Tiquo.render()
Watch authentication
Tiquo.onAuthStateChange(callback)
Set consent
Tiquo.setConsent(mode)
Get consent
Tiquo.getConsent()
Call methods inside Tiquo.ready when they depend on the Hosted Package being loaded.
The Hosted Package does not expose raw access or refresh token getters. For automatic submission and bubbling form events, use HTML form bindings. Calling a method directly leaves form feedback to your own code.
Guest invitations and passes
After customer sign-in, use the invitation helpers to build a guest-registration experience:
const { guestFlows } = await window.Tiquo.getGuestFlows();
const flow = await window.Tiquo.getGuestFlow('GUEST_FLOW_ID');
const { guestPasses } = await window.Tiquo.getGuestPasses();
const invitation = await window.Tiquo.getGuestInvitation(invitationToken);
// The signed-in guest accepts the invitation.
const accepted = await window.Tiquo.acceptGuestInvitation(invitationToken);createGuestInvitations(input) accepts flowId, visitDate, optional locationId, and guests containing one UUID v4 token and guestFirstName per guest. Retain tokens when retrying an unchanged pending invitation. Share the returned inviteUrl and shareText.
Use requiresGuestPass to select the allowance: availableGuestPassQuantity for a limited flow, or maxGuestsPerSubmission otherwise. In limited mode, creating an invitation reserves a Guest Pass; staff registration consumes it.
getGuestFlows() is cached for the session. Creating or accepting an invitation refreshes it; otherwise use getGuestFlow(flowId) or getGuestFlows({ refresh: true }) for fresh data.
getGuestPasses() lists invitations, one per guest and visit. For how many Guest Passes or Access Passes the customer has left, use getPassBalances().
See Custom Guest Invitations for the end-to-end walkthrough (the method names are the same in both packages), Render Guest Pass invitations and Pass balances for the HTML attributes, and Guest Invitations and Passes for fields, errors, and retry rules.