Developers · Guides
Build your own booking site for a gym
A complete members’ booking experience on your own website or app, with Bookare doing the work behind it.
This guide builds what a gym or studio needs: the timetable, sign-in, booking and cancelling, packs and payment. Everything here uses the public and customer endpoints, so it can run entirely in the browser or a mobile app. No API key involved.
1. Show the timetable
GET /public/classes?from=2026-12-01&to=2026-12-07
Each class has id, class_type, date, time, minutes, spots, spots_left, instructor, off_peak and started.
Group by date and show a “Book” button unless spots_left is 0 or started is true. Classes without set times (“drop-in”,
like an open gym) are not listed; they are used with check-in at the venue.
Show packs to visitors with GET /public/packs (price, classes, validity, on_sale_until for limited-time packs).
2. Sign in
POST /auth/code { "email": "maria@example.com" }
POST /auth/token { "email": "maria@example.com", "code": "482913", "challenge": "…" }
New people sign up in the second call with signup (name, phone, consent and optional health answers): see
authentication. New members are pending until the venue approves them: show a
friendly “we’ll confirm your account shortly” and let them look around.
3. Book
POST /me/bookings { "class_id": "…" }
Bookare picks the pack that expires first and covers this class (the class type, off-peak only, validity). Answers to handle:
| Answer | Meaning | Show |
|---|---|---|
201 |
Booked, a class taken from the pack | “See you there!” and the message |
409 |
The class is full | Offer another time |
422 |
No suitable pack, pack unpaid beyond what the venue allows, account not approved | The message, and a link to buy a pack |
4. Their bookings, and cancelling
GET /me/bookings?scope=upcoming
DELETE /me/bookings/{booking_id}
Each booking has free_cancellation_until. Cancelling before it returns the class to the pack; after it, the booking is
cancelled but the class is charged (late: true). Say so before they press cancel.
5. Packs and buying
GET /me/packs their packs: state, classes left, expiry, paid
GET /me/packs/available?code=SUMMER what they can buy, with coupon prices
POST /me/packs { "pack_id": "…", "method": "card", "code": "SUMMER" }
available includes special packs meant only for this member or their groups, applies automatic coupons, and lists
payment_methods the venue accepts (cash, iris, card). Only one unpaid pack at a time: a second purchase answers 409.
After buying, next says what to do: checkout (card), pay_by_iris (show iris.number, iris.payee, iris.reference),
pay_at_venue or paid.
6. Card payment
POST /me/packs/{id}/checkout
Answers { "type": "redirect", "url" } (open the URL) or { "type": "form", "action", "fields" } (post those fields to
action). The page belongs to the venue’s own payment provider. See Taking payments from your own app.
7. Nice extras
GET /me/notificationsandGET /me/offers: the venue’s news and offers for this member.PATCH /me { "wants_news": true }: consent for offers.- Members still get Bookare’s emails (booking confirmations for packs, class changes, reminders on phones that turned notifications on), so you do not have to send them.
Related
- Customer API reference
- Public API reference
- The booking widget, if a ready-made timetable is enough