curl --request POST \
--url https://api.1club.ai/v1/platform/booking-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"clubIds": [
123
],
"validFor": {
"scopes": [],
"classTypes": [
123
],
"areaTypes": [
123
],
"instructorTypes": [
123
]
},
"eventIds": [
123
],
"audience": {
"memberTypes": [],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": true,
"checkInRequired": true,
"autoCheckIn": true,
"allowAnonymousBookings": true,
"allowGuestBookings": true,
"allowWalkInCheckins": true,
"allowAnonymousCheckins": true,
"allowedProductCategoryIds": [
123
],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": true,
"upsellPlanIds": [
123
]
}
'import requests
url = "https://api.1club.ai/v1/platform/booking-policies"
payload = {
"name": "<string>",
"clubIds": [123],
"validFor": {
"scopes": [],
"classTypes": [123],
"areaTypes": [123],
"instructorTypes": [123]
},
"eventIds": [123],
"audience": {
"memberTypes": [],
"tags": ["<string>"],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123],
"pipelineStageIds": [123],
"sourceIds": [123]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": True,
"checkInRequired": True,
"autoCheckIn": True,
"allowAnonymousBookings": True,
"allowGuestBookings": True,
"allowWalkInCheckins": True,
"allowAnonymousCheckins": True,
"allowedProductCategoryIds": [123],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": True,
"upsellPlanIds": [123]
}
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({
name: '<string>',
clubIds: [123],
validFor: {scopes: [], classTypes: [123], areaTypes: [123], instructorTypes: [123]},
eventIds: [123],
audience: {
memberTypes: [],
tags: ['<string>'],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123],
pipelineStageIds: [123],
sourceIds: [123]
},
cancellationRules: [{hoursInAdvance: 4380, refundPercentage: 50, description: '<string>'}],
chargeAdvanceDays: 182,
minBookingSlotMinutes: 1,
maxBookingSlotMinutes: 1,
maxBookInAdvanceDays: 1,
minBookingNoticeHours: 1,
waiveNoticeWhenBooked: true,
checkInRequired: true,
autoCheckIn: true,
allowAnonymousBookings: true,
allowGuestBookings: true,
allowWalkInCheckins: true,
allowAnonymousCheckins: true,
allowedProductCategoryIds: [123],
waitlistClaimWindowMinutes: 1,
upsellAvailablePlans: true,
upsellPlanIds: [123]
})
};
fetch('https://api.1club.ai/v1/platform/booking-policies', 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/booking-policies",
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([
'name' => '<string>',
'clubIds' => [
123
],
'validFor' => [
'scopes' => [
],
'classTypes' => [
123
],
'areaTypes' => [
123
],
'instructorTypes' => [
123
]
],
'eventIds' => [
123
],
'audience' => [
'memberTypes' => [
],
'tags' => [
'<string>'
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
],
'pipelineStageIds' => [
123
],
'sourceIds' => [
123
]
],
'cancellationRules' => [
[
'hoursInAdvance' => 4380,
'refundPercentage' => 50,
'description' => '<string>'
]
],
'chargeAdvanceDays' => 182,
'minBookingSlotMinutes' => 1,
'maxBookingSlotMinutes' => 1,
'maxBookInAdvanceDays' => 1,
'minBookingNoticeHours' => 1,
'waiveNoticeWhenBooked' => true,
'checkInRequired' => true,
'autoCheckIn' => true,
'allowAnonymousBookings' => true,
'allowGuestBookings' => true,
'allowWalkInCheckins' => true,
'allowAnonymousCheckins' => true,
'allowedProductCategoryIds' => [
123
],
'waitlistClaimWindowMinutes' => 1,
'upsellAvailablePlans' => true,
'upsellPlanIds' => [
123
]
]),
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/booking-policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\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/booking-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/booking-policies")
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 \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"policyId": 123,
"name": "<string>",
"kind": "booking",
"clubIds": [
123
],
"validFor": {
"scopes": [
"classes"
],
"classTypes": [
123
],
"areaTypes": [
123
],
"instructorTypes": [
123
]
},
"eventIds": [
123
],
"audience": {
"memberTypes": [
"contact"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"forcePayment": "none",
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"bookingDurationStepMinutes": 30,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": true,
"checkInRequired": true,
"autoCheckIn": true,
"allowAnonymousBookings": true,
"allowGuestBookings": true,
"allowWalkInCheckins": true,
"allowAnonymousCheckins": true,
"allowedProductCategoryIds": [
123
],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": true,
"upsellPlanIds": [
123
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Create a booking policy
Adds a booking policy. It governs new bookings at once; a booking already made keeps the cancellation terms it was made under.
name and clubIds are required. clubIds: [] links the policy to no club, which makes it apply at every club - and as the newer of two equally specific policies it takes over from the one that governed there - so that has to be asked for, never fallen into by leaving the field out. Every other field may be omitted and takes the policy default: free cancellation, no payment forced, every flag off, governing every booking for everyone.
The rules a policy must meet: cancellation rules have distinct hoursInAdvance and refunds that never grow as the booking approaches (all at 0% is a non-refundable policy); bookingDurationStepMinutes is 30 or 60; minBookingSlotMinutes is at most maxBookingSlotMinutes and a whole number of steps; chargeAdvanceDays is at most 365; forcePayment: at_booking needs an online card payment provider at the policy’s clubs (code BOOKING_POLICY_NEEDS_ONLINE_PAYMENT). Every id - clubs, types, events, plans, product categories - must belong to this organization. An event policy takes no validFor and no audience. Supports the Idempotency-Key header.
curl --request POST \
--url https://api.1club.ai/v1/platform/booking-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"clubIds": [
123
],
"validFor": {
"scopes": [],
"classTypes": [
123
],
"areaTypes": [
123
],
"instructorTypes": [
123
]
},
"eventIds": [
123
],
"audience": {
"memberTypes": [],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": true,
"checkInRequired": true,
"autoCheckIn": true,
"allowAnonymousBookings": true,
"allowGuestBookings": true,
"allowWalkInCheckins": true,
"allowAnonymousCheckins": true,
"allowedProductCategoryIds": [
123
],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": true,
"upsellPlanIds": [
123
]
}
'import requests
url = "https://api.1club.ai/v1/platform/booking-policies"
payload = {
"name": "<string>",
"clubIds": [123],
"validFor": {
"scopes": [],
"classTypes": [123],
"areaTypes": [123],
"instructorTypes": [123]
},
"eventIds": [123],
"audience": {
"memberTypes": [],
"tags": ["<string>"],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123],
"pipelineStageIds": [123],
"sourceIds": [123]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": True,
"checkInRequired": True,
"autoCheckIn": True,
"allowAnonymousBookings": True,
"allowGuestBookings": True,
"allowWalkInCheckins": True,
"allowAnonymousCheckins": True,
"allowedProductCategoryIds": [123],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": True,
"upsellPlanIds": [123]
}
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({
name: '<string>',
clubIds: [123],
validFor: {scopes: [], classTypes: [123], areaTypes: [123], instructorTypes: [123]},
eventIds: [123],
audience: {
memberTypes: [],
tags: ['<string>'],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123],
pipelineStageIds: [123],
sourceIds: [123]
},
cancellationRules: [{hoursInAdvance: 4380, refundPercentage: 50, description: '<string>'}],
chargeAdvanceDays: 182,
minBookingSlotMinutes: 1,
maxBookingSlotMinutes: 1,
maxBookInAdvanceDays: 1,
minBookingNoticeHours: 1,
waiveNoticeWhenBooked: true,
checkInRequired: true,
autoCheckIn: true,
allowAnonymousBookings: true,
allowGuestBookings: true,
allowWalkInCheckins: true,
allowAnonymousCheckins: true,
allowedProductCategoryIds: [123],
waitlistClaimWindowMinutes: 1,
upsellAvailablePlans: true,
upsellPlanIds: [123]
})
};
fetch('https://api.1club.ai/v1/platform/booking-policies', 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/booking-policies",
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([
'name' => '<string>',
'clubIds' => [
123
],
'validFor' => [
'scopes' => [
],
'classTypes' => [
123
],
'areaTypes' => [
123
],
'instructorTypes' => [
123
]
],
'eventIds' => [
123
],
'audience' => [
'memberTypes' => [
],
'tags' => [
'<string>'
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
],
'pipelineStageIds' => [
123
],
'sourceIds' => [
123
]
],
'cancellationRules' => [
[
'hoursInAdvance' => 4380,
'refundPercentage' => 50,
'description' => '<string>'
]
],
'chargeAdvanceDays' => 182,
'minBookingSlotMinutes' => 1,
'maxBookingSlotMinutes' => 1,
'maxBookInAdvanceDays' => 1,
'minBookingNoticeHours' => 1,
'waiveNoticeWhenBooked' => true,
'checkInRequired' => true,
'autoCheckIn' => true,
'allowAnonymousBookings' => true,
'allowGuestBookings' => true,
'allowWalkInCheckins' => true,
'allowAnonymousCheckins' => true,
'allowedProductCategoryIds' => [
123
],
'waitlistClaimWindowMinutes' => 1,
'upsellAvailablePlans' => true,
'upsellPlanIds' => [
123
]
]),
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/booking-policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\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/booking-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/booking-policies")
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 \"name\": \"<string>\",\n \"clubIds\": [\n 123\n ],\n \"validFor\": {\n \"scopes\": [],\n \"classTypes\": [\n 123\n ],\n \"areaTypes\": [\n 123\n ],\n \"instructorTypes\": [\n 123\n ]\n },\n \"eventIds\": [\n 123\n ],\n \"audience\": {\n \"memberTypes\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ]\n },\n \"cancellationRules\": [\n {\n \"hoursInAdvance\": 4380,\n \"refundPercentage\": 50,\n \"description\": \"<string>\"\n }\n ],\n \"chargeAdvanceDays\": 182,\n \"minBookingSlotMinutes\": 1,\n \"maxBookingSlotMinutes\": 1,\n \"maxBookInAdvanceDays\": 1,\n \"minBookingNoticeHours\": 1,\n \"waiveNoticeWhenBooked\": true,\n \"checkInRequired\": true,\n \"autoCheckIn\": true,\n \"allowAnonymousBookings\": true,\n \"allowGuestBookings\": true,\n \"allowWalkInCheckins\": true,\n \"allowAnonymousCheckins\": true,\n \"allowedProductCategoryIds\": [\n 123\n ],\n \"waitlistClaimWindowMinutes\": 1,\n \"upsellAvailablePlans\": true,\n \"upsellPlanIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"policyId": 123,
"name": "<string>",
"kind": "booking",
"clubIds": [
123
],
"validFor": {
"scopes": [
"classes"
],
"classTypes": [
123
],
"areaTypes": [
123
],
"instructorTypes": [
123
]
},
"eventIds": [
123
],
"audience": {
"memberTypes": [
"contact"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
]
},
"cancellationRules": [
{
"hoursInAdvance": 4380,
"refundPercentage": 50,
"description": "<string>"
}
],
"forcePayment": "none",
"chargeAdvanceDays": 182,
"minBookingSlotMinutes": 1,
"maxBookingSlotMinutes": 1,
"bookingDurationStepMinutes": 30,
"maxBookInAdvanceDays": 1,
"minBookingNoticeHours": 1,
"waiveNoticeWhenBooked": true,
"checkInRequired": true,
"autoCheckIn": true,
"allowAnonymousBookings": true,
"allowGuestBookings": true,
"allowWalkInCheckins": true,
"allowAnonymousCheckins": true,
"allowedProductCategoryIds": [
123
],
"waitlistClaimWindowMinutes": 1,
"upsellAvailablePlans": true,
"upsellPlanIds": [
123
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.
Headers
Retry-safe key; a repeat of the same request replays the first response
255Body
Fields accepted when creating a booking policy. clubIds must be present: an empty list applies the policy at every club, where it takes over from the policy that governed there, so it has to be asked for. Everything else takes the policy default when omitted. Unknown fields are rejected.
Internal name, shown to staff in the admin portal.
1 - 255Clubs the policy applies at. Empty means every club. Required on create.
500booking (the default) governs bookings of courts, coaches and classes. event decides only what event tickets refund on cancellation, and takes no validFor or audience.
booking, event What the policy governs. No scopes means every booking. Each scope listed (classes, areas, instructors) takes in bookings of that kind, all of them unless its type list (classTypes, areaTypes, instructorTypes) narrows it; a type list must not be empty and must belong to a listed scope. null on a write is the same as {}.
Show child attributes
Show child attributes
Event policies only: the events it covers. Empty means every event.
500Who the policy governs. Every list set must match: a contact of one of memberTypes, carrying one of tags, holding one of membershipPlanIds (or a plan in membershipPlanCategoryIds), and so on. null means everyone. A policy with an audience never applies to an anonymous booking.
Show child attributes
Show child attributes
The refund ladder. The first band whose notice the member met decides the refund; meeting none refunds nothing. hoursInAdvance must be distinct and refunds may not grow as the booking approaches. Empty is free cancellation at any time; every band at 0% is non-refundable (canonically one band, 0 hours at 0%).
20Show child attributes
Show child attributes
at_booking sends members to an online card checkout before the booking is confirmed, and needs an online card payment provider at the policy clubs. at_checkin takes payment on arrival.
none, at_booking, at_checkin Days before each occurrence of a recurring booking that its charge is written. null uses the platform default of 3. Not used while payment is taken at booking.
0 <= x <= 365Shortest booking allowed. A whole number of steps, and at most maxBookingSlotMinutes.
x >= 0Longest booking allowed.
x >= 0The step a booking length grows by.
30, 60, null How many days ahead members may book. null is no limit.
x >= 0How late before the start members may still book. null is no limit.
x >= 0Lift minBookingNoticeHours for a class someone has already booked, since it is confirmed to run.
A booking not checked in by the end of the day is marked a no-show.
Check the booking in automatically when it starts.
Staff may book without naming a contact.
Logged-out visitors may book without an account or password, giving their details at checkout.
Staff may check in a contact who has no booking.
Staff may check in a visitor with no contact record.
Product categories offered with the booking confirmation. Empty offers none.
500Minutes the first person on a waitlist has to claim a place that opens shortly before a class. null uses the default of 15.
x >= 0Offer plans at booking.
The plans offered at booking.
500Response
Booking policy created
The rules a booking is held to: cancellation terms, payment timing, booking window, slot grid and check-in rules. Scoped on WHAT it governs (validFor) and WHO (audience), narrowed to clubIds; when several apply, the most specific wins. An event policy instead decides what event tickets refund.
Internal name, shown to staff in the admin portal.
1 - 255booking (the default) governs bookings of courts, coaches and classes. event decides only what event tickets refund on cancellation, and takes no validFor or audience.
booking, event Clubs the policy applies at. Empty means every club. Required on create.
500What the policy governs. {} means every booking. Always {} on an event policy.
Show child attributes
Show child attributes
Event policies only: the events it covers. Empty means every event.
500Who the policy governs. null means everyone. Always null on an event policy.
Show child attributes
Show child attributes
The refund ladder. The first band whose notice the member met decides the refund; meeting none refunds nothing. hoursInAdvance must be distinct and refunds may not grow as the booking approaches. Empty is free cancellation at any time; every band at 0% is non-refundable (canonically one band, 0 hours at 0%).
20Show child attributes
Show child attributes
at_booking sends members to an online card checkout before the booking is confirmed, and needs an online card payment provider at the policy clubs. at_checkin takes payment on arrival.
none, at_booking, at_checkin Days before each occurrence of a recurring booking that its charge is written. null uses the platform default of 3. Not used while payment is taken at booking.
0 <= x <= 365Shortest booking allowed. A whole number of steps, and at most maxBookingSlotMinutes.
x >= 0Longest booking allowed.
x >= 0The step a booking length grows by.
30, 60, null How many days ahead members may book. null is no limit.
x >= 0How late before the start members may still book. null is no limit.
x >= 0Lift minBookingNoticeHours for a class someone has already booked, since it is confirmed to run.
A booking not checked in by the end of the day is marked a no-show.
Check the booking in automatically when it starts.
Staff may book without naming a contact.
Logged-out visitors may book without an account or password, giving their details at checkout.
Staff may check in a contact who has no booking.
Staff may check in a visitor with no contact record.
Product categories offered with the booking confirmation. Empty offers none.
500Minutes the first person on a waitlist has to claim a place that opens shortly before a class. null uses the default of 15.
x >= 0Offer plans at booking.
The plans offered at booking.
500Was this page helpful?