Sign in to see your venue's slug and publishable key in every sample.
Your account has no venue yet, so the samples keep their placeholders. Sign out
Signed in as · . Create a publishable key in the console and reload to see it here. Sign out
Signed in as · . The samples show your venue's publishable key. Sign out
Developer docs
Play clock
Start, pause, resume, stop and reset the play clock of a game booked by the hour, and read the minutes played and the till amount.
A booking on a resource priced per hour (a billiard table, a dart board) has a play clock. Staff start it when the guests begin to play and stop it when they finish; the booking then shows the minutes played and a suggested amount for the venue's own till. These routes are operator routes: they take the signed-in operator's token, never an API key, act on the venue the token (and an optional X-BookDinePlay-Venue header) selects, and are open to every team role from Staff up.
What a clock write does
- Start records the exact instant from the server's clock and moves the booking's start to that minute, keeping its length, so the plan shows the expected end. It is allowed from 15 minutes before the booked start, on the booking's own business day, for a
Confirmedbooking or aPendingone with no deposit owed and no open request. If another booking starts on that very minute on the same resource, the clock still starts and the booked times stay. - Stop records the stop instant, ends the booking at that time (rounded up to the next minute, never less than a minute after the start) and sets it to
Completed, for that booking only, not the other members of a group. - Pause stops counting while the guests take a break (food, a phone call) and keep the resource; Resume counts on. Only played time counts: the minutes and the till amount add up every played stretch and round up once over the total, never per stretch. A pause moves nothing else: the booking keeps its resource and its booked end (so the next guests' time is not taken), and a game past that end still shows as running over. Stop works on a paused clock too; the time from the pause to the stop is not played.
- Reset undoes an accidental Start while the clock runs or is paused: the booked times come back and the clock, with every pause, is gone. With
undoStopit undoes an accidental Stop made in the last two minutes instead, and the clock runs again (or is paused again, if it was stopped while paused).
A clock write records what happened at the bar: it is not judged by the overlap, opening-hours or capacity rules a booking is, so a game may run into the next booking or past closing time. The summary then says so. No clock write sends the guest anything (no e-mail, push or SMS), and once a clock has started, the guest's cancel link refuses with reservation-cancellation-not-allowed.
Every route answers 200 with the booking's operator summary, the same shape GET /api/operator/venue/reservations/{reference} returns. A write whose target is already reached (Start on a running or paused clock, Stop on a stopped one, Pause on a paused one, Resume on a running one, Reset with no clock) is a retry: it changes nothing and answers 200 with the current state, so a client may safely retry after a timeout.
Endpoints
Start
POST /api/operator/venue/reservations/{reference}/play-clock/start, no body: starts the clock now.
Stop
POST /api/operator/venue/reservations/{reference}/play-clock/stop, optional body:
| Field | Required | Meaning |
|---|---|---|
stoppedAt |
no | A correction: the instant play really stopped, ISO 8601 with an offset. Accepted on a running, paused or stopped clock, when it lies after the clock's last start or resume and not in the future; otherwise a 400 on stoppedAt. Omitted: the clock stops now. |
Pause and resume
POST /api/operator/venue/reservations/{reference}/play-clock/pause and POST …/play-clock/resume, no body: pause a running clock now, or resume a paused one. A clock that has not started or has stopped is refused with clock-not-running; one clock holds at most 50 pauses (clock-pause-limit).
Reset
POST /api/operator/venue/reservations/{reference}/play-clock/reset, optional body:
| Field | Required | Meaning |
|---|---|---|
undoStop |
no | false (default): undo a Start while the clock runs or is paused. true: undo a Stop of the last two minutes. |
curl
curl -X POST "https://api.bookdineplay.com/api/operator/venue/reservations/BDP-7Q2M3K/play-clock/stop" \
-H "Authorization: Bearer $OPERATOR_TOKEN" \
-H "X-BookDinePlay-Venue: your-venue" \
-H "Content-Type: application/json" \
-d '{ "stoppedAt": "2026-12-11T20:47:10+01:00" }'JavaScript
// Server-side or in your own console: the bearer token is the signed-in operator's, never a venue key.
const response = await fetch('https://api.bookdineplay.com/api/operator/venue/reservations/BDP-7Q2M3K/play-clock/stop', {
method: 'POST',
headers: {
Authorization: `Bearer ${operatorToken}`,
'X-BookDinePlay-Venue': 'your-venue',
'Content-Type': 'application/json'
},
body: JSON.stringify({ stoppedAt: '2026-12-11T20:47:10+01:00' })
});
const booking = await response.json();
console.log(booking.clockMinutes, booking.clockAmount, booking.clockCurrency);C#
// `http` is an HttpClient with the operator's bearer token and the API base address.
var response = await http.PostAsJsonAsync(
"api/operator/venue/reservations/BDP-7Q2M3K/play-clock/stop",
new StopPlayClockRequest(DateTimeOffset.Parse("2026-12-11T20:47:10+01:00")), cancellationToken);
var booking = await response.Content.ReadFromJsonAsync<AdminReservationSummary>(cancellationToken);
Console.WriteLine($"{booking!.ClockMinutes} min, {booking.ClockAmount} {booking.ClockCurrency}");PHP
<?php
$response = wp_remote_post( 'https://api.bookdineplay.com/api/operator/venue/reservations/BDP-7Q2M3K/play-clock/stop', [
'headers' => [
'Authorization' => 'Bearer ' . $operator_token,
'X-BookDinePlay-Venue' => 'your-venue',
'Content-Type' => 'application/json',
],
'body' => wp_json_encode( [ 'stoppedAt' => '2026-12-11T20:47:10+01:00' ] ),
] );
$booking = json_decode( wp_remote_retrieve_body( $response ), true );
echo "{$booking['clockMinutes']} min, {$booking['clockAmount']} {$booking['clockCurrency']}\n";The clock on the summary
The operator summary carries the clock in these fields, all computed by the server when the booking is read:
| Field | Meaning |
|---|---|
clockAvailable |
The booking has a clock: its resource is priced per hour and it can be started, or its clock has started. Clients never work this out themselves. |
clockStartedAt, clockStoppedAt |
The clock's instants, UTC. |
clockMinutes |
Every started minute of play: to the stop, or to the moment of the read while the clock runs. Paused time does not count; the played stretches are added up and rounded up once. |
clockHourlyPrice, clockCurrency |
The hourly price captured at Start. A later price change does not change it. |
clockAmount |
Once stopped: clockMinutes times the hourly price divided by 60, rounded to the cent. A suggestion for the venue's own till, computed on every read and never stored or settled by BookDinePlay. It is the gross amount; a deposit paid online or by voucher is shown separately by the deposit fields. |
clockOverrun |
For a running or paused clock: pastBookedEnd, the next booking it runs into (intoReference, intoCustomerName, intoStart, intoIsWalkIn) and pastClosing. Null when it runs into nothing. A pause does not move the booked end. |
clockPaused, clockPausedAt |
The clock is paused now, and since when (UTC). Omitted otherwise. |
clockPausedSeconds |
All paused time so far, in whole seconds rounded down (an ongoing pause up to the read; clockMinutes is authoritative). Omitted while the clock was never paused. A running clock's played time is the time since clockStartedAt minus this, so a client can tick it between reads. |
{
"reference": "BDP-7Q2M3K",
"status": "Completed",
"start": "19:00",
"end": "19:48",
"clockAvailable": true,
"clockStartedAt": "2026-12-11T18:00:00+00:00",
"clockStoppedAt": "2026-12-11T18:47:10+00:00",
"clockMinutes": 48,
"clockHourlyPrice": 12.00,
"clockCurrency": "EUR",
"clockAmount": 9.60
}Refusals
A write that cannot apply answers 409 play-clock-refused with a reason, and nothing changes. An unknown reference, or one of another venue, is a 404. The walk-in route can book and start the clock in one call: send "startClock": true to POST /api/operator/venue/reservations/walk-in for a resource priced per hour.
Edits while the clock moves
A Stop moves the booking's end, a late Start moves its start, and either can happen on one device while the booking is open for editing on another. So that an edit never undoes them, the operator summary carries revision, an opaque stamp of the booking's status, resource, times and clock state. Send it back as basedOnRevision on PUT /api/operator/venue/reservations/{reference}: when the booking has changed since, the edit is refused with 409 reservation-changed and nothing is written. Read the booking again and make the edit on the fresh values. Without basedOnRevision the server still compares the booking it read with the one it writes over, so a clock write that lands in between refuses the edit as well. Compare revision for equality only; its format may change.
Once the clock is stopped, the game is finished and keeps the times the clock gave it: an edit may change its notes, contact details and party, but an edit that moves it or changes its length is refused with 409 reservation-not-editable. Correct the end with the stop correction above (or undo the stop within two minutes).