curl --request PATCH \
--url https://api.1club.ai/v1/platform/pricing-rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"isActive": true,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"scopes": [
{
"ids": [
123
]
}
],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"isActive": True,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"scopes": [{ "ids": [123] }],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
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>',
description: '<string>',
isActive: true,
priority: 123,
percentageAdjustment: 0,
fixedAmountAdjustment: 123,
scopes: [{ids: [123]}],
conditions: [
{
type: 'weekdays-time',
config: {weekdays: [], startTime: '<string>', endTime: '<string>'}
}
]
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules/{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/pricing-rules/{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>',
'description' => '<string>',
'isActive' => true,
'priority' => 123,
'percentageAdjustment' => 0,
'fixedAmountAdjustment' => 123,
'scopes' => [
[
'ids' => [
123
]
]
],
'conditions' => [
[
'type' => 'weekdays-time',
'config' => [
'weekdays' => [
],
'startTime' => '<string>',
'endTime' => '<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/pricing-rules/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\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/pricing-rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/pricing-rules/{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 \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ruleId": 123,
"name": "<string>",
"description": "<string>",
"isActive": true,
"priority": 123,
"adjustmentType": "percentage",
"percentageAdjustment": 123,
"fixedAmountAdjustment": 123,
"scopes": [
{
"type": "areas",
"ids": [
123
]
}
],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [
"monday"
],
"startTime": "<string>",
"endTime": "<string>",
"match": "segment"
}
}
],
"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 pricing rule
Edits a pricing rule. Send only what changes; an omitted field is left alone. scopes and conditions each replace the whole list when sent - read the rule first and send the list you want.
A change to the adjustment is judged on the rule it produces: switching to fixed or absolute needs an amount (sent, or already stored), and switching to percentage needs the percentage in the same request. Renaming or switching off a rule is always allowed. The change applies to new quotes and bookings at once.
curl --request PATCH \
--url https://api.1club.ai/v1/platform/pricing-rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"isActive": true,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"scopes": [
{
"ids": [
123
]
}
],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"isActive": True,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"scopes": [{ "ids": [123] }],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
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>',
description: '<string>',
isActive: true,
priority: 123,
percentageAdjustment: 0,
fixedAmountAdjustment: 123,
scopes: [{ids: [123]}],
conditions: [
{
type: 'weekdays-time',
config: {weekdays: [], startTime: '<string>', endTime: '<string>'}
}
]
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules/{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/pricing-rules/{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>',
'description' => '<string>',
'isActive' => true,
'priority' => 123,
'percentageAdjustment' => 0,
'fixedAmountAdjustment' => 123,
'scopes' => [
[
'ids' => [
123
]
]
],
'conditions' => [
[
'type' => 'weekdays-time',
'config' => [
'weekdays' => [
],
'startTime' => '<string>',
'endTime' => '<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/pricing-rules/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\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/pricing-rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/pricing-rules/{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 \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ruleId": 123,
"name": "<string>",
"description": "<string>",
"isActive": true,
"priority": 123,
"adjustmentType": "percentage",
"percentageAdjustment": 123,
"fixedAmountAdjustment": 123,
"scopes": [
{
"type": "areas",
"ids": [
123
]
}
],
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [
"monday"
],
"startTime": "<string>",
"endTime": "<string>",
"match": "segment"
}
}
],
"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 pricing rule id
Body
Fields accepted when updating a pricing rule. Send only what changes; an omitted field is left alone, and at least one is required. A changed adjustment is judged on the rule it produces. Unknown fields are rejected.
Internal name, shown to staff in the admin portal. Never shown to members.
1 - 255Internal note. null clears it.
2000A switched-off rule prices nothing but is kept. Defaults to true on create.
Precedence when several rules match one slot: LOWER wins. Give the most specific rule the smallest number. Defaults to 0 on create.
absolute states the hourly price outright; fixed adds an amount per hour; percentage moves the price by a percentage.
percentage, fixed, absolute Percentage rules only: -10 is 10% off, 20 is 20% more.
-100 <= x <= 100Fixed rules: the amount added per hour, negative for a discount. Absolute rules: the hourly price, zero or more. Scaled by the booking length.
Which resources the rule prices. Empty means every area, coach and class. Replaces the whole list when sent on an update.
20Show child attributes
Show child attributes
When the rule applies; every condition must hold. Empty or omitted means always. Replaces the whole list when sent on an update.
20One condition a booking must meet for the rule to apply. Weekday names are lowercase English; times are 24-hour HH:mm in the club timezone (24:00 ends a window at midnight); dates are YYYY-MM-DD.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
Show child attributes
Show child attributes
Response
The updated pricing rule
One rule of the organization's price list. It applies to the resources its scopes name (none means every area, coach and class) when every one of its conditions holds; when several rules match one slot, the lowest priority wins. Rules are silent: members see the resulting price, never the rule's name.
Lower wins.
percentage, fixed, absolute Set on percentage rules; null on the others.
The per-hour delta of a fixed rule or the hourly price of an absolute one; null on percentage rules.
Show child attributes
Show child attributes
One condition a booking must meet for the rule to apply. Weekday names are lowercase English; times are 24-hour HH:mm in the club timezone (24:00 ends a window at midnight); dates are YYYY-MM-DD.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
Show child attributes
Show child attributes
Was this page helpful?