curl --request PATCH \
--url https://api.1club.ai/v1/platform/booking-policies/{id} \
--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/{id}"
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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{id}"
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("PATCH", 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.patch("https://api.1club.ai/v1/platform/booking-policies/{id}")
.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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Update a booking policy
Edits a booking policy. Send only what changes; an omitted field is left alone. Lists (clubIds, eventIds, cancellationRules, allowedProductCategoryIds, upsellPlanIds) and the validFor and audience objects replace what is stored when sent - read the policy first and send the whole value you want. null clears a number or the audience.
The same rules as on create apply, judged against the policy as it will stand: a new step must still divide the stored minimum slot. Changing kind clears what the other kind carried (an audience when it becomes an event policy, event ids when it becomes a booking policy). Bookings already made keep the cancellation terms they were made under.
curl --request PATCH \
--url https://api.1club.ai/v1/platform/booking-policies/{id} \
--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/{id}"
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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{id}"
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("PATCH", 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.patch("https://api.1club.ai/v1/platform/booking-policies/{id}")
.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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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": {}
}{
"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
255Path Parameters
1club booking policy id
Body
Fields accepted when updating a booking policy. Send only what changes; an omitted field is left alone, and at least one is required. Lists and the validFor and audience objects replace what is stored. Unknown fields are rejected.
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. 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
The updated booking policy
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?