Skip to main content

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​

What the venue sets up first​

The API serves what the venue has configured in Odoo. Before you start, ask the venue to:

  1. Install Court Booking API (it installs Online Court Booking with it).
  2. 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.
  3. 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).
  4. For online payment, publish a payment provider (Invoicing > Configuration > Payment Providers).
  5. For SMS codes, buy Odoo SMS credits (or connect another SMS gateway).
  6. 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, slot start) are the venue's local wall-clock time as YYYY-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_at of a token, hold_expires_at of a booking) are UTC as YYYY-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, and today stays 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 *_label already 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​

MethodPathSign-inWhat it does
GET/confignoVenue, sign-in methods, facility types
GET/facility-typesnoFacility types bookable online
GET/availabilitynoFree start times and courts with prices for one day
GET/openapi.jsonnoOpenAPI 3 description
POST/auth/codenoSend a one-time code by SMS or email
POST/auth/verifynoCheck the code, create the account if new, return a token
POST/auth/loginnoSign in with email and password
POST/auth/signupnoCreate an account with a password
POST/auth/logoutyesSign this device out
GET, PATCH/meyesRead or change the player's name, phone and email
GET/bookingsyesUpcoming or past bookings
POST/bookingsyesBook a court
GET/bookings/{id}yesOne booking
POST/bookings/{id}/cancelyesCancel a booking
POST/bookings/{id}/payment-linkyesFresh payment link for what is due online

Next​

  1. Sign-in and tokens
  2. Venue and availability
  3. Bookings
  4. Online payment
  5. Errors and limits
  6. Code samples
  7. Go-live checklist
Was this page helpful?