Skip to main content

Bookings

All booking calls need the player's token.

POST /bookings​

{
"facility_type_id": 1,
"start": "2026-11-22 21:00",
"duration": 90,
"court_id": 1,
"players": 4,
"note": "Left-handed, need a racket",
"client_uuid": "7f3c2a8e-1b4d-4c55-9a21-0d3e6f9b8c11"
}
FieldRequiredMeaning
facility_type_idyesFrom /config
startyesA slot start from /availability, venue local time
durationyesMinutes, one of the type's durations
court_idnoA court from the slot's courts. Leave it out to let Odoo give the first free court.
playersnoNumber of players
notenoNote for the venue (up to 500 characters)
client_uuidrecommendedA new random UUID for each booking the player confirms; see below

The answer is 201 with the booking:

{
"data": {
"id": 78,
"uuid": "179368b8-ebf8-4605-ac03-529f165cec22",
"reference": "BK/2026/00078",
"facility_type": {
"id": 1,
"name": "Padel"
},
"court": {
"id": 1,
"name": "Court 1"
},
"start": "2026-11-22 21:00",
"stop": "2026-11-22 22:30",
"date_label": "Sunday 22 November 2026",
"time_label": "21:00-22:30",
"duration": 90,
"players": 4,
"note": "Left-handed, need a racket",
"state": "hold",
"state_label": "On Hold",
"currency": "USD",
"amount": 82.5,
"amount_label": "$ 82.50",
"paid_amount": 0.0,
"paid_amount_label": "",
"amount_due": 82.5,
"amount_due_label": "$ 82.50",
"payment_status": "unpaid",
"online_payment": "deposit",
"amount_due_online": 20.63,
"amount_due_online_label": "$ 20.63",
"hold_expires_at": "2026-11-19 07:21:48",
"can_cancel": true,
"cancel_blocked_reason": "",
"channel": "app",
"past": false,
"payment": {
"required_online": true,
"amount": 20.63,
"pay_url": "https://booking.example.com/book/pay/78?access_token=5c1f0e9a-3b7d-4e62-a8f4-2d91c6b07e35"
}
}
}

What happens next depends on the facility type's payment rule:

  • Pay at the venue (online_payment: "venue"): the booking is confirmed at once and the player gets a confirmation email. payment.required_online is false.
  • Deposit or full payment online: the booking is hold and the court is kept for the player until hold_expires_at (UTC, 15 minutes by default). Open payment.pay_url to pay; see Online payment. An unpaid hold expires by itself and frees the court.

Double taps and retries: client_uuid​

Mobile networks drop answers. When the app retries a booking whose first request did reach Odoo, a second booking must not be made. Create a UUID when the player taps Book, and send the same UUID with every retry of that request. Odoo answers a repeated client_uuid with the booking it already made instead of booking again. Create a new UUID for the next booking.

Limits​

  • A player can hold a limited number of upcoming bookings at a time (3 by default, set per facility type). Past that, the booking is refused with a message to show.
  • start must be a free slot for the whole duration, inside opening hours and the booking window.

When a court was just taken​

Between loading availability and tapping Book, someone else may book the same court. The answer is 422:

{
"error": {
"code": "rejected",
"message": "This slot can't be booked: this court was just booked by someone else. Please pick another time or court."
}
}

Show the message, then load /availability again. When court_id was left out, Odoo already tried every court of the type, so a refusal means the whole time is gone.

GET /bookings​

The player's bookings. scope=upcoming (the default) lists bookings that have not ended and are on hold, confirmed or checked in, soonest first. scope=past lists played, cancelled and no-show bookings, latest first. Up to 50 are returned.

GET /api/booking/v1/bookings?scope=upcoming
{
"data": [
{
"id": 78,
"uuid": "179368b8-ebf8-4605-ac03-529f165cec22",
"reference": "BK/2026/00078",
"facility_type": {
"id": 1,
"name": "Padel"
},
"court": {
"id": 1,
"name": "Court 1"
},
"start": "2026-11-22 21:00",
"stop": "2026-11-22 22:30",
"date_label": "Sunday 22 November 2026",
"time_label": "21:00-22:30",
"duration": 90,
"players": 4,
"note": "Left-handed, need a racket",
"state": "hold",
"state_label": "On Hold",
"currency": "USD",
"amount": 82.5,
"amount_label": "$ 82.50",
"paid_amount": 0.0,
"paid_amount_label": "",
"amount_due": 82.5,
"amount_due_label": "$ 82.50",
"payment_status": "unpaid",
"online_payment": "deposit",
"amount_due_online": 20.63,
"amount_due_online_label": "$ 20.63",
"hold_expires_at": "2026-11-19 07:21:48",
"can_cancel": true,
"cancel_blocked_reason": "",
"channel": "app",
"past": false,
"payment": {
"required_online": true,
"amount": 20.63,
"pay_url": "https://booking.example.com/book/pay/78?access_token=5c1f0e9a-3b7d-4e62-a8f4-2d91c6b07e35"
}
}
]
}

Bookings made at the counter or on the website for the same player appear here too, so the app shows everything the player has at the venue.

GET /bookings/{id}​

One booking. A booking of another player answers 404, as if it did not exist.

POST /bookings/{id}/cancel​

{"reason": "Rain plans changed"}

reason is optional. The answer is the cancelled booking:

{
"data": {
"id": 79,
"reference": "BK/2026/00079",
"facility_type": {
"id": 2,
"name": "Futsal 5-a-side"
},
"court": {
"id": 5,
"name": "Pitch 1"
},
"start": "2026-11-22 15:00",
"stop": "2026-11-22 16:00",
"state": "cancelled",
"state_label": "Cancelled",
"amount": 80.0,
"amount_label": "$ 80.00",
"can_cancel": false,
"cancel_blocked_reason": "This booking cannot be cancelled."
}
}

(Shortened: the answer is the full booking object.)

Use can_cancel and cancel_blocked_reason of the booking to show or hide the Cancel button and to explain why. A player can cancel in the app when:

  • the booking is on hold or confirmed and has not started, and
  • nothing has been paid on it (a booking with a payment is cancelled by the venue, which also handles the refund), and
  • for a confirmed booking, the start is more than the type's cancel_hours away.

Otherwise the answer is 422 with the reason, for example:

{
"error": {
"code": "rejected",
"message": "This booking cannot be cancelled."
}
}

The booking object​

FieldMeaning
idUse it in /bookings/{id}
uuidOdoo's unique id of the booking
referenceBooking number to show and to quote at the counter (BK/2026/00078)
facility_type, courtid and name
start, stopVenue local time, YYYY-MM-DD HH:MM
date_label, time_labelReady to show: "Sunday 22 November 2026", "21:00-22:30"
duration, players, noteAs booked
state, state_labelSee below
amount, amount_labelPrice of the booking, tax included
paid_amount, paid_amount_labelPaid so far (online, at the POS or at the counter)
amount_due, amount_due_labelStill to pay in total
payment_statusunpaid, partial or paid
online_paymentPayment rule when it was booked: venue, deposit or full
amount_due_online, amount_due_online_labelStill to pay online now (0 when nothing is due online)
hold_expires_atUTC moment the hold ends, only while state is hold
can_cancel, cancel_blocked_reasonWhether the player can cancel in the app, and why not
channelWhere it was booked: app, website, pos, backend or external
pasttrue once the booking has ended
paymentrequired_online, amount and pay_url: see Online payment

States​

StateMeaning for the player
holdCourt kept while the player pays online. Shows a countdown to hold_expires_at.
confirmedBooked
checked_inThe player arrived and was checked in at the counter
donePlayed
cancelledCancelled by the player or the venue
no_showThe player did not come
expiredThe hold ran out without payment. Not listed in /bookings; GET /bookings/{id} still shows it, and a payment link can take the court again if it is still free.
Was this page helpful?