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>"
},
"promotion": {
"promotionId": 123,
"name": "<string>",
"discount": 123,
"totalAfterDiscount": 123
}
}{
"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 an area 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>"
},
"promotion": {
"promotionId": 123,
"name": "<string>",
"discount": 123,
"totalAfterDiscount": 123
}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
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.
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.
Was this page helpful?