Quickstart
From nothing to a working "Book a court" button on your website.
About ten minutes, most of it spent in your payment gateway's dashboard. You need to be an admin on your gamexo dashboard, and able to edit your website's HTML (or have whoever does it paste one line).
Connect a payment gateway
Settings → Integrations, then open Razorpay and paste your Key ID and Key Secret. Start in Test mode — you can put a real booking through without moving real money, and connect the live keys later as a separate connection.
Open the gateway panel and turn on Collect online (the Dashboard switch) so that online bookings use this account. If you run several branches, see how branches choose a gateway.
Razorpay only, for now
Leo Cal can take a payment with Razorpay today. Other gateways can be connected for your counter, but a customer on your website will be told online booking isn't available with them yet.
Create a browser key
Settings → Integrations → Your own website or app → Generate key.
-
Name it after the website, for example
Acme Turf Site. -
Under Where will the key live? choose In their website's JavaScript.
-
Under Their website address, list every address the widget will appear on, one per line, with the scheme:
https://yourvenue.com https://www.yourvenue.comyourvenue.comandwww.yourvenue.comare different addresses, so list both if your site answers on both. Usehttp://localhost:3000(your own port) while testing on your laptop.
Press Generate key. You are shown the embed code with the key already filled in. This is the only time the key is shown in full — copy the code now. If you lose it, rotate the key and paste the new one.
A browser key is safe to publish
It starts with gxp_. It can only read availability and start a checkout that your
payment gateway must complete — it cannot book without paying, set a price, read
bookings or customer details, or cancel. Never put a secret key (gx_…) on a
website. See Security.
Paste the code on your site
Put the script once on the page, then add a button or a card:
<script src="https://cal.turfleo.com/v1/embed.js" data-key="gxp_…" async></script>
<button data-leo-cal>Book a court</button>Open the page, click the button, and the booking pop-up appears with your venue's courts and prices. WordPress, React and card layouts are covered in Embedding and WordPress.
Make a test booking
Pick a slot, enter a name and phone number, and pay with one of Razorpay's test cards. You should see:
- a confirmation with a booking reference in the widget, and
- the booking on your dashboard's Bookings page, marked Paid and tagged with the website's name.
Add the webhook
Without it, a customer who pays and closes the tab in the same second is charged but not booked. It takes two minutes — see the Razorpay webhook.
Go live
Connect your live Razorpay keys, switch the connection to Live, and add the webhook in Razorpay's Live mode too (Test and Live have separate webhooks). Make one real booking of the cheapest slot you sell, then cancel and refund it from your Razorpay dashboard to confirm money flows end to end.
If something does not work
Most first-run problems are one of three things: the site's address is not in the key's list, the gateway is not set to collect online, or the page loaded the script twice with different keys. Troubleshooting walks through each.