Skip to main content

Bookings API

Create and manage tee time bookings via API.

Endpoints

MethodEndpointDescription
POST/bookingsCreate a booking
GET/bookings/{id}Get booking details
PUT/bookings/{id}Update a booking
DELETE/bookings/{id}Cancel a booking
GET/players/me/bookingsList user's bookings

Create Booking

Request

POST /bookings
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
"courseId": "championship-course",
"teeTime": "2025-01-15T08:00:00Z",
"players": 4,
"playerDetails": [
{
"name": "John Smith",
"email": "john@example.com",
"phone": "+27821234567"
}
],
"options": {
"cart": true,
"caddy": false
}
}

Response

{
"data": {
"id": "bk_abc123",
"status": "CONFIRMED",
"courseId": "championship-course",
"teeTime": "2025-01-15T08:00:00Z",
"players": 4,
"totalAmount": 1800,
"currency": "ZAR",
"reference": "BK-2025-12345",
"createdAt": "2025-01-10T14:30:00Z"
}
}

Get Booking

Request

GET /bookings/bk_abc123
Authorization: Bearer YOUR_TOKEN

Response

{
"data": {
"id": "bk_abc123",
"status": "CONFIRMED",
"courseId": "championship-course",
"courseName": "Championship Course",
"teeTime": "2025-01-15T08:00:00Z",
"players": 4,
"playerDetails": [
{
"name": "John Smith",
"email": "john@example.com",
"isOwner": true
}
],
"pricing": {
"greenFee": 1600,
"cartHire": 200,
"total": 1800,
"currency": "ZAR"
},
"reference": "BK-2025-12345",
"checkInCode": "QR_DATA_HERE",
"createdAt": "2025-01-10T14:30:00Z"
}
}

Update Booking

Request

PUT /bookings/bk_abc123
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
"players": 3,
"playerDetails": [
{ "name": "John Smith", "email": "john@example.com" },
{ "name": "Jane Doe", "email": "jane@example.com" },
{ "name": "Bob Wilson", "email": "bob@example.com" }
]
}

Response

{
"data": {
"id": "bk_abc123",
"status": "CONFIRMED",
"players": 3,
"priceDifference": -450,
"refundAmount": 450,
"updatedAt": "2025-01-11T10:00:00Z"
}
}

Cancel Booking

Request

DELETE /bookings/bk_abc123
Authorization: Bearer YOUR_TOKEN

Response

{
"data": {
"id": "bk_abc123",
"status": "CANCELLED",
"refundAmount": 1800,
"refundStatus": "PENDING",
"cancelledAt": "2025-01-11T10:00:00Z"
}
}

List User Bookings

Request

GET /players/me/bookings?status=CONFIRMED&from=2025-01-01
Authorization: Bearer YOUR_TOKEN

Query Parameters

ParameterTypeDescription
statusstringFilter by status
fromdateStart date
todateEnd date
limitnumberResults per page
offsetnumberPagination offset

Response

{
"data": [
{
"id": "bk_abc123",
"courseName": "Championship Course",
"teeTime": "2025-01-15T08:00:00Z",
"players": 4,
"status": "CONFIRMED"
}
],
"meta": {
"total": 5,
"limit": 10,
"offset": 0
}
}

Booking Status

StatusDescription
PENDINGAwaiting payment
CONFIRMEDBooking confirmed
CHECKED_INPlayer has arrived
COMPLETEDRound finished
CANCELLEDBooking cancelled
NO_SHOWPlayer didn't arrive

Error Codes

CodeDescription
SLOT_UNAVAILABLETee time no longer available
INVALID_PLAYERSPlayer count invalid
PAYMENT_FAILEDPayment not processed
PAST_CANCELLATIONCannot cancel this close to tee time
BOOKING_NOT_FOUNDBooking ID not found

Webhooks

Subscribe to booking events:

{
"event": "booking.confirmed",
"data": {
"bookingId": "bk_abc123",
"courseId": "championship-course",
"teeTime": "2025-01-15T08:00:00Z"
},
"timestamp": "2025-01-10T14:30:00Z"
}

Available events:

  • booking.confirmed
  • booking.modified
  • booking.cancelled
  • booking.checked_in