curl --request POST \
--url https://api.1club.ai/v1/platform/pricing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
{
"ids": [
123
]
}
],
"description": "<string>",
"isActive": true,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules"
payload = {
"name": "<string>",
"scopes": [{ "ids": [123] }],
"description": "<string>",
"isActive": True,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<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({
name: '<string>',
scopes: [{ids: [123]}],
description: '<string>',
isActive: true,
priority: 123,
percentageAdjustment: 0,
fixedAmountAdjustment: 123,
conditions: [
{
type: 'weekdays-time',
config: {weekdays: [], startTime: '<string>', endTime: '<string>'}
}
]
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules', 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",
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>',
'scopes' => [
[
'ids' => [
123
]
]
],
'description' => '<string>',
'isActive' => true,
'priority' => 123,
'percentageAdjustment' => 0,
'fixedAmountAdjustment' => 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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\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/pricing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\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")
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 \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\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": {}
}Create a pricing rule
Adds a rule to the price list. It applies to new quotes and bookings at once; bookings already made keep the price they were made at.
adjustmentType decides what the rule says: absolute states the hourly price outright (in fixedAmountAdjustment), fixed adds that amount per hour (negative for a discount), and percentage moves the price by percentageAdjustment, -100 to 100. Send only the field your type reads; the other is refused.
scopes must be sent: it says which areas, coaches, clubs or class types the rule prices, and an empty list makes it apply to every one of them - so that has to be asked for. conditions narrow when it applies; every condition must hold. When several rules match one slot, the lowest priority wins. Every id a rule names - in a scope, a plan condition or a with-instructor condition - must belong to this organization.
A time-of-day condition (weekdays-time) is a price band by default: the booking is split at the band’s edges and only the part inside it is priced by the rule. Set match to start or within to judge the whole booking instead. Supports the Idempotency-Key header.
curl --request POST \
--url https://api.1club.ai/v1/platform/pricing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
{
"ids": [
123
]
}
],
"description": "<string>",
"isActive": true,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<string>"
}
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules"
payload = {
"name": "<string>",
"scopes": [{ "ids": [123] }],
"description": "<string>",
"isActive": True,
"priority": 123,
"percentageAdjustment": 0,
"fixedAmountAdjustment": 123,
"conditions": [
{
"type": "weekdays-time",
"config": {
"weekdays": [],
"startTime": "<string>",
"endTime": "<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({
name: '<string>',
scopes: [{ids: [123]}],
description: '<string>',
isActive: true,
priority: 123,
percentageAdjustment: 0,
fixedAmountAdjustment: 123,
conditions: [
{
type: 'weekdays-time',
config: {weekdays: [], startTime: '<string>', endTime: '<string>'}
}
]
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules', 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",
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>',
'scopes' => [
[
'ids' => [
123
]
]
],
'description' => '<string>',
'isActive' => true,
'priority' => 123,
'percentageAdjustment' => 0,
'fixedAmountAdjustment' => 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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\n \"conditions\": [\n {\n \"type\": \"weekdays-time\",\n \"config\": {\n \"weekdays\": [],\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\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/pricing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\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")
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 \"scopes\": [\n {\n \"ids\": [\n 123\n ]\n }\n ],\n \"description\": \"<string>\",\n \"isActive\": true,\n \"priority\": 123,\n \"percentageAdjustment\": 0,\n \"fixedAmountAdjustment\": 123,\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": {}
}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 pricing rule. scopes must be present: an empty list applies the rule to every area, coach and class, so it has to be asked for. Send only the amount field your adjustmentType reads. Unknown fields are rejected.
Internal name, shown to staff in the admin portal. Never shown to members.
1 - 255absolute states the hourly price outright; fixed adds an amount per hour; percentage moves the price by a percentage.
percentage, fixed, absolute 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
Internal 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.
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.
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
Pricing rule created
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?