Skip to main content
POST
Create a pricing rule

Authorizations

Authorization
string
header
required

Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.

Headers

Idempotency-Key
string

Retry-safe key; a repeat of the same request replays the first response

Maximum string length: 255

Body

application/json

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.

name
string
required

Internal name, shown to staff in the admin portal. Never shown to members.

Required string length: 1 - 255
adjustmentType
enum<string>
required

absolute states the hourly price outright; fixed adds an amount per hour; percentage moves the price by a percentage.

Available options:
percentage,
fixed,
absolute
scopes
object[]
required

Which resources the rule prices. Empty means every area, coach and class. Replaces the whole list when sent on an update.

Maximum array length: 20
description
string | null

Internal note. null clears it.

Maximum string length: 2000
isActive
boolean

A switched-off rule prices nothing but is kept. Defaults to true on create.

priority
integer

Precedence when several rules match one slot: LOWER wins. Give the most specific rule the smallest number. Defaults to 0 on create.

percentageAdjustment
number

Percentage rules only: -10 is 10% off, 20 is 20% more.

Required range: -100 <= x <= 100
fixedAmountAdjustment
number | null

Fixed rules: the amount added per hour, negative for a discount. Absolute rules: the hourly price, zero or more. Scaled by the booking length.

conditions
object[]

When the rule applies; every condition must hold. Empty or omitted means always. Replaces the whole list when sent on an update.

Maximum array length: 20

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.

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.

ruleId
integer
name
string
description
string | null
isActive
boolean
priority
integer

Lower wins.

adjustmentType
enum<string>
Available options:
percentage,
fixed,
absolute
percentageAdjustment
number | null

Set on percentage rules; null on the others.

fixedAmountAdjustment
number | null

The per-hour delta of a fixed rule or the hourly price of an absolute one; null on percentage rules.

scopes
object[]
conditions
object[]

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.

createdAt
string<date-time>
updatedAt
string<date-time>