curl --request POST \
--url https://api.1club.ai/v1/platform/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"customer": {
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"payment": {
"amount": 123
},
"channel": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/bookings"
payload = {
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"customer": {
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"payment": { "amount": 123 },
"channel": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
areaId: 123,
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
customer: {
email: 'jsmith@example.com',
firstName: '<string>',
lastName: '<string>',
phone: '<string>'
},
payment: {amount: 123},
channel: '<string>',
notes: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/bookings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'areaId' => 123,
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'customer' => [
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>',
'phone' => '<string>'
],
'payment' => [
'amount' => 123
],
'channel' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/bookings"
payload := strings.NewReader("{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/bookings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bookingId": 123,
"status": "<string>",
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"payment": {
"amount": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create a booking
Creates a booking on an area (e.g. a padel court) for a customer. The customer is matched to a contact by email (created if new). A booking transaction is recorded so it counts for revenue: paid marks it settled against the External / API payment method (no gateway call), unpaid leaves it outstanding. amount defaults to the area’s price for the slot. Send an Idempotency-Key header to make retries safe — the same key returns the original booking (HTTP 200).
curl --request POST \
--url https://api.1club.ai/v1/platform/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"customer": {
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"payment": {
"amount": 123
},
"channel": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/bookings"
payload = {
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"customer": {
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"payment": { "amount": 123 },
"channel": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
areaId: 123,
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
customer: {
email: 'jsmith@example.com',
firstName: '<string>',
lastName: '<string>',
phone: '<string>'
},
payment: {amount: 123},
channel: '<string>',
notes: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/bookings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'areaId' => 123,
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'customer' => [
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>',
'phone' => '<string>'
],
'payment' => [
'amount' => 123
],
'channel' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/bookings"
payload := strings.NewReader("{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/bookings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"areaId\": 123,\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"customer\": {\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"payment\": {\n \"amount\": 123\n },\n \"channel\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bookingId": 123,
"status": "<string>",
"areaId": 123,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"payment": {
"amount": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Customer API key obtained from the admin portal (e.g. 1club_sk_live_...)
Body
Response
Booking created
A booking created through the platform API. Recorded with a booking transaction so it counts for revenue, marked paid (settled against the External / API payment method) or unpaid (outstanding) per the caller. Refunds and collection stay with the caller.
Was this page helpful?