curl --request POST \
--url https://api.1club.ai/v1/platform/pricing-rules/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"areaId": 123,
"instructorId": 123,
"classId": 123,
"classTypeId": 123,
"planIds": [
123
],
"contactId": 123,
"clubId": 123,
"groupSize": 2,
"ignoreMembershipCoverage": true
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules/quote"
payload = {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"areaId": 123,
"instructorId": 123,
"classId": 123,
"classTypeId": 123,
"planIds": [123],
"contactId": 123,
"clubId": 123,
"groupSize": 2,
"ignoreMembershipCoverage": True
}
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({
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
areaId: 123,
instructorId: 123,
classId: 123,
classTypeId: 123,
planIds: [123],
contactId: 123,
clubId: 123,
groupSize: 2,
ignoreMembershipCoverage: true
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules/quote', 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/quote",
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([
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'areaId' => 123,
'instructorId' => 123,
'classId' => 123,
'classTypeId' => 123,
'planIds' => [
123
],
'contactId' => 123,
'clubId' => 123,
'groupSize' => 2,
'ignoreMembershipCoverage' => true
]),
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/quote"
payload := strings.NewReader("{\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/pricing-rules/quote")
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 \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\n}"
response = http.request(request)
puts response.read_body{
"basePrice": 123,
"finalPrice": 123,
"appliedRules": [
{
"ruleId": 123,
"ruleName": "<string>",
"adjustmentType": "percentage",
"percentageAdjustment": 123,
"fixedAmountAdjustment": 123,
"amount": 123,
"priceAfter": 123
}
],
"tax": {
"rate": 123,
"amount": 123,
"name": "<string>",
"inclusive": true,
"totalWithTax": 123
},
"membershipCoverage": {
"covered": true,
"membershipId": 123,
"membershipName": "<string>",
"sessionUnit": "session",
"requiredUnits": 123,
"usesRemainingBefore": 123,
"note": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Quote a booking price
What a booking would cost, priced by the same calculator checkout uses: the resource’s base rate, every pricing rule that applies, tax, and whether a membership the contact holds would cover it. Nothing is booked or held. Use it to check a rule does what was meant after writing it.
Name what is being booked with areaId, instructorId or classId (an area with an instructor prices a court booked with a coach). Pass contactId to price for a particular person - their plans unlock member rates and may cover the booking outright - or planIds to ask “what would a holder of this plan pay?” without naming anyone. ignoreMembershipCoverage quotes the list price even when a membership would cover it. clubId is the club the booking lands in, which only matters for a coach who works at every club.
Every id must belong to this organization. A booking is quoted for at most 24 hours.
curl --request POST \
--url https://api.1club.ai/v1/platform/pricing-rules/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"areaId": 123,
"instructorId": 123,
"classId": 123,
"classTypeId": 123,
"planIds": [
123
],
"contactId": 123,
"clubId": 123,
"groupSize": 2,
"ignoreMembershipCoverage": true
}
'import requests
url = "https://api.1club.ai/v1/platform/pricing-rules/quote"
payload = {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"areaId": 123,
"instructorId": 123,
"classId": 123,
"classTypeId": 123,
"planIds": [123],
"contactId": 123,
"clubId": 123,
"groupSize": 2,
"ignoreMembershipCoverage": True
}
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({
startTime: '2023-11-07T05:31:56Z',
endTime: '2023-11-07T05:31:56Z',
areaId: 123,
instructorId: 123,
classId: 123,
classTypeId: 123,
planIds: [123],
contactId: 123,
clubId: 123,
groupSize: 2,
ignoreMembershipCoverage: true
})
};
fetch('https://api.1club.ai/v1/platform/pricing-rules/quote', 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/quote",
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([
'startTime' => '2023-11-07T05:31:56Z',
'endTime' => '2023-11-07T05:31:56Z',
'areaId' => 123,
'instructorId' => 123,
'classId' => 123,
'classTypeId' => 123,
'planIds' => [
123
],
'contactId' => 123,
'clubId' => 123,
'groupSize' => 2,
'ignoreMembershipCoverage' => true
]),
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/quote"
payload := strings.NewReader("{\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/pricing-rules/quote")
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 \"startTime\": \"2023-11-07T05:31:56Z\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"areaId\": 123,\n \"instructorId\": 123,\n \"classId\": 123,\n \"classTypeId\": 123,\n \"planIds\": [\n 123\n ],\n \"contactId\": 123,\n \"clubId\": 123,\n \"groupSize\": 2,\n \"ignoreMembershipCoverage\": true\n}"
response = http.request(request)
puts response.read_body{
"basePrice": 123,
"finalPrice": 123,
"appliedRules": [
{
"ruleId": 123,
"ruleName": "<string>",
"adjustmentType": "percentage",
"percentageAdjustment": 123,
"fixedAmountAdjustment": 123,
"amount": 123,
"priceAfter": 123
}
],
"tax": {
"rate": 123,
"amount": 123,
"name": "<string>",
"inclusive": true,
"totalWithTax": 123
},
"membershipCoverage": {
"covered": true,
"membershipId": 123,
"membershipName": "<string>",
"sessionUnit": "session",
"requiredUnits": 123,
"usesRemainingBefore": 123,
"note": "<string>"
}
}{
"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.
Body
A booking to price. Name what is booked with areaId, instructorId or classId; every id must belong to this organization. Unknown fields are rejected.
ISO date-time with an offset.
After startTime, and at most 24 hours later.
The area (court, room) being booked.
The coach being booked. With areaId, a court booked with a coach.
A class being booked into.
Price as this class type. Derived from classId when left out.
Price as a holder of these plans, without naming a person.
20Price for this person: their plans unlock member rates and may cover the booking. Also requires the contacts:read scope.
The club the booking lands in. Only matters for a coach who works at every club.
How many people a session with a coach and no court is for.
x >= 1Quote the list price even when a membership would cover the booking.
Response
The quoted price, with the rules that produced it
What a booking would cost, from the same calculator checkout uses. Nothing is booked or held.
The resource's own rate for the booking, before any rule.
The price after every rule, before tax is added.
The rules that moved the price, in the order they applied. A rule pricing several time bands appears once per band.
Show child attributes
Show child attributes
Tax on the price, or null when none applies.
Show child attributes
Show child attributes
Whether a membership the contact holds would cover the booking, making it free to them.
Show child attributes
Show child attributes
Was this page helpful?