Court Booking API
The Court Booking API app gives your own player apps (Android, iPhone, desktop or web) the same booking flow as the Odoo website: sign in, see free courts with prices, book, pay online and cancel. Staff keep working in Odoo and at the Point of Sale: an app booking appears on the schedule at once, and a court booked at the counter disappears from the app at once.
This guide is for the developers of those apps. Every example on these pages is a real response from a demo venue.
Base URL
https://<your-odoo-domain>/api/booking/v1
Use the public domain of the venue's Odoo website (for example https://booking.example.com/api/booking/v1). The API answers for the company of that website, so one Odoo database with several venues on several website domains gives each app its own venue.
The live description of every endpoint is at /api/booking/v1/openapi.json (OpenAPI 3). Load it in Swagger UI, Postman or an OpenAPI code generator.
Downloads
- OpenAPI 3 description (set the
hostvariable to the venue's domain) - Postman collection: set
base_url, then Request code and Verify code; the token is saved for the other requests.
What the venue sets up first
The API serves what the venue has configured in Odoo. Before you start, ask the venue to:
- Install Court Booking API (it installs Online Court Booking with it).
- Tick Bookable Online on each facility type the app should show (Court Booking > Configuration > Facility Types, Online Booking tab), and set its online payment rule, deposit, payment time, cancellation cut-off and limit per customer.
- Choose how customers sign in in Settings > Court Booking > Customer sign-in (phone or email code, password, or both) and how codes are sent (SMS, email, or SMS with email as fallback).
- For online payment, publish a payment provider (Invoicing > Configuration > Payment Providers).
- For SMS codes, buy Odoo SMS credits (or connect another SMS gateway).
- Make sure web.base.url is the public https domain: payment links are built from it.
Format of every response
Requests and responses are JSON (Content-Type: application/json). A success puts the result in data:
{"data": {"signed_out": true}}
An error puts a stable code and a message in error. The message is written for players, in the venue's language, so you can show it as it is:
{"error": {"code": "invalid_code", "message": "That code is not right."}}
The HTTP status tells you the kind of problem; see Errors and limits.
Times, dates and money
- Booking times (
start,stop, slotstart) are the venue's local wall-clock time asYYYY-MM-DD HH:MM, with no time zone. Show them as they are and send them back as they are. Do not convert them to the phone's time zone: a player in another city still plays at the venue's 21:00. - Moments (
expires_atof a token,hold_expires_atof a booking) are UTC asYYYY-MM-DD HH:MM:SS. Use them for countdowns. - Dates are
YYYY-MM-DD. A date is an operating day: when a venue is open until 02:00, the 00:30 slot belongs to the evening before, andtodaystays the evening's date until closing time. - Durations are minutes (
60,90,120). - Amounts are numbers in the venue currency, tax included. Every amount comes with a
*_labelalready formatted for display ($ 82.50).
Quick start
Five calls from opening the app to a booked court. With curl against a demo venue:
1. Read the venue and its facility types (no sign-in needed)
curl https://booking.example.com/api/booking/v1/config
2. Ask for a sign-in code by SMS
curl -X POST https://booking.example.com/api/booking/v1/auth/code \
-H "Content-Type: application/json" \
-d '{"identifier": "(646) 555-0147"}'
3. Verify the code and get a token
curl -X POST https://booking.example.com/api/booking/v1/auth/verify \
-H "Content-Type: application/json" \
-d '{"identifier": "(646) 555-0147", "code": "482913", "name": "Sara Ahmed", "device": "Pixel 8 (Android)"}'
4. See the free courts on a day
curl "https://booking.example.com/api/booking/v1/availability?facility_type_id=1&date=2026-11-22&duration=90"
5. Book one
curl -X POST https://booking.example.com/api/booking/v1/bookings \
-H "Authorization: Bearer fbk_9oQm1x7Kc2LwTqV4sZr8NbYp3HdE6uFa0JgXiC5tAkM" \
-H "Content-Type: application/json" \
-d '{"facility_type_id": 1, "start": "2026-11-22 21:00", "duration": 90, "court_id": 1, "players": 4, "client_uuid": "7f3c2a8e-1b4d-4c55-9a21-0d3e6f9b8c11"}'
When the facility type is paid at the venue, the booking is confirmed straight away. When a deposit or full payment is due online, the booking is on hold and its payment.pay_url opens the payment page; see Online payment.
All endpoints
| Method | Path | Sign-in | What it does |
|---|---|---|---|
| GET | /config | no | Venue, sign-in methods, facility types |
| GET | /facility-types | no | Facility types bookable online |
| GET | /availability | no | Free start times and courts with prices for one day |
| GET | /openapi.json | no | OpenAPI 3 description |
| POST | /auth/code | no | Send a one-time code by SMS or email |
| POST | /auth/verify | no | Check the code, create the account if new, return a token |
| POST | /auth/login | no | Sign in with email and password |
| POST | /auth/signup | no | Create an account with a password |
| POST | /auth/logout | yes | Sign this device out |
| GET, PATCH | /me | yes | Read or change the player's name, phone and email |
| GET | /bookings | yes | Upcoming or past bookings |
| POST | /bookings | yes | Book a court |
| GET | /bookings/{id} | yes | One booking |
| POST | /bookings/{id}/cancel | yes | Cancel a booking |
| POST | /bookings/{id}/payment-link | yes | Fresh payment link for what is due online |