{
    "openapi": "3.1.0",
    "info": {
        "title": "SportsCarnival Club API",
        "version": "1.1.0",
        "description": "Read your club's events, reservations, leagues, users and sales, and create and change events, reservations, leagues and users. Create a key in your club admin under Settings, send it as a bearer token, and every request works on your club and no other. See https://sportscarnival.com/api/v1/docs for the guide."
    },
    "servers": [
        {
            "url": "https://sportscarnival.com/api/v1"
        }
    ],
    "security": [
        {
            "apiKey": []
        }
    ],
    "tags": [
        {
            "name": "Getting started"
        },
        {
            "name": "Events"
        },
        {
            "name": "Reservations"
        },
        {
            "name": "Leagues"
        },
        {
            "name": "Users"
        },
        {
            "name": "Sales"
        },
        {
            "name": "Reports"
        }
    ],
    "paths": {
        "/": {
            "get": {
                "operationId": "getKey",
                "tags": [
                    "Getting started"
                ],
                "summary": "Check a key",
                "description": "The club and key behind the request, and the scopes the key holds. Needs no scope: call it first to test a new key.",
                "security": [
                    {
                        "apiKey": []
                    }
                ],
                "x-required-scope": null,
                "x-error-codes": [],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "club": {
                                            "id": 12,
                                            "name": "Northside Pickleball",
                                            "slug": "northside-pickleball",
                                            "timezone": "America/Chicago",
                                            "currency": "USD"
                                        },
                                        "key": {
                                            "name": "Zapier",
                                            "prefix": "sck_a1B2c3D4",
                                            "scopes": [
                                                "events:read",
                                                "reservations:write"
                                            ],
                                            "expires_at": null
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/events": {
            "get": {
                "operationId": "getEvents",
                "tags": [
                    "Events"
                ],
                "summary": "List events",
                "description": "The club's events, earliest start first. Deleted events are not listed.",
                "security": [
                    {
                        "apiKey": [
                            "events:read"
                        ]
                    }
                ],
                "x-required-scope": "events:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Only events in this state.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "published",
                                "unpublished",
                                "archived",
                                "scheduled"
                            ]
                        },
                        "example": "published"
                    },
                    {
                        "name": "starts_from",
                        "in": "query",
                        "required": false,
                        "description": "Events starting on or after this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-01"
                    },
                    {
                        "name": "starts_to",
                        "in": "query",
                        "required": false,
                        "description": "Events starting on or before this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-31"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Event"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 42,
                                            "title": "Spring Round Robin",
                                            "slug": "spring-round-robin",
                                            "description": "<p>Doubles, all levels.</p>",
                                            "status": "published",
                                            "starts_at": "2026-03-14T15:00:00+00:00",
                                            "starts_at_local": "2026-03-14 10:00:00",
                                            "ends_at": "2026-03-14T18:00:00+00:00",
                                            "ends_at_local": "2026-03-14 13:00:00",
                                            "all_day": false,
                                            "category": {
                                                "id": 3,
                                                "name": "Tournaments"
                                            },
                                            "location": {
                                                "id": 2,
                                                "name": "Main hall"
                                            },
                                            "price": "25.00",
                                            "members_only": false,
                                            "capacity": 32,
                                            "registered_count": 18,
                                            "spots_left": 14,
                                            "created_at": "2026-01-12T16:04:09+00:00",
                                            "updated_at": "2026-02-02T19:30:00+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createEvents",
                "tags": [
                    "Events"
                ],
                "summary": "Create an event",
                "description": "Creates an event and its registration form. The event is `unpublished` unless you send `status: published`, so nothing reaches the club's site by accident. Ticket types, images, category and location are set in the club admin.",
                "security": [
                    {
                        "apiKey": [
                            "events:write"
                        ]
                    }
                ],
                "x-required-scope": "events:write",
                "x-error-codes": [],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "title",
                                    "starts_at_local"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "The event's title."
                                    },
                                    "starts_at_local": {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                                        "description": "When it starts, on the club's clock."
                                    },
                                    "ends_at_local": {
                                        "anyOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "When it ends, on the club's clock. Not before the start. Null means the start, as does leaving it out on create."
                                    },
                                    "description": {
                                        "anyOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "The public description, as HTML. Scripts and other unsafe markup are removed."
                                    },
                                    "price": {
                                        "anyOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^-?\\d+\\.\\d{2}$"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "The base price, with at most two decimals."
                                    },
                                    "capacity": {
                                        "anyOf": [
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "Spots available. Null for unlimited."
                                    },
                                    "members_only": {
                                        "type": "boolean",
                                        "description": "Whether only members can register."
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "published",
                                            "unpublished"
                                        ],
                                        "description": "`unpublished` unless given."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "title": "Spring Round Robin",
                                "starts_at_local": "2026-03-14 10:00",
                                "ends_at_local": "2026-03-14 13:00",
                                "description": "<p>Doubles, all levels.</p>",
                                "price": "25.00",
                                "capacity": 32,
                                "members_only": false,
                                "status": "published"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Event"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 42,
                                        "title": "Spring Round Robin",
                                        "slug": "spring-round-robin",
                                        "description": "<p>Doubles, all levels.</p>",
                                        "status": "published",
                                        "starts_at": "2026-03-14T15:00:00+00:00",
                                        "starts_at_local": "2026-03-14 10:00:00",
                                        "ends_at": "2026-03-14T18:00:00+00:00",
                                        "ends_at_local": "2026-03-14 13:00:00",
                                        "all_day": false,
                                        "category": {
                                            "id": 3,
                                            "name": "Tournaments"
                                        },
                                        "location": {
                                            "id": 2,
                                            "name": "Main hall"
                                        },
                                        "price": "25.00",
                                        "members_only": false,
                                        "capacity": 32,
                                        "registered_count": 18,
                                        "spots_left": 14,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/events/{event}": {
            "get": {
                "operationId": "getEventsOne",
                "tags": [
                    "Events"
                ],
                "summary": "Get an event",
                "description": "One event by id.",
                "security": [
                    {
                        "apiKey": [
                            "events:read"
                        ]
                    }
                ],
                "x-required-scope": "events:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "description": "The event's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Event"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 42,
                                        "title": "Spring Round Robin",
                                        "slug": "spring-round-robin",
                                        "description": "<p>Doubles, all levels.</p>",
                                        "status": "published",
                                        "starts_at": "2026-03-14T15:00:00+00:00",
                                        "starts_at_local": "2026-03-14 10:00:00",
                                        "ends_at": "2026-03-14T18:00:00+00:00",
                                        "ends_at_local": "2026-03-14 13:00:00",
                                        "all_day": false,
                                        "category": {
                                            "id": 3,
                                            "name": "Tournaments"
                                        },
                                        "location": {
                                            "id": 2,
                                            "name": "Main hall"
                                        },
                                        "price": "25.00",
                                        "members_only": false,
                                        "capacity": 32,
                                        "registered_count": 18,
                                        "spots_left": 14,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "operationId": "updateEventsOne",
                "tags": [
                    "Events"
                ],
                "summary": "Update an event",
                "description": "Changes the fields you send and leaves the rest. Set `status` to publish, unpublish or archive.",
                "security": [
                    {
                        "apiKey": [
                            "events:write"
                        ]
                    }
                ],
                "x-required-scope": "events:write",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "description": "The event's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "The event's title."
                                    },
                                    "starts_at_local": {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                                        "description": "When it starts, on the club's clock."
                                    },
                                    "ends_at_local": {
                                        "anyOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "When it ends, on the club's clock. Not before the start. Null means the start, as does leaving it out on create."
                                    },
                                    "description": {
                                        "anyOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "The public description, as HTML. Scripts and other unsafe markup are removed."
                                    },
                                    "price": {
                                        "anyOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^-?\\d+\\.\\d{2}$"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "The base price, with at most two decimals."
                                    },
                                    "capacity": {
                                        "anyOf": [
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "Spots available. Null for unlimited."
                                    },
                                    "members_only": {
                                        "type": "boolean",
                                        "description": "Whether only members can register."
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "published",
                                            "unpublished",
                                            "archived"
                                        ],
                                        "description": "Publish, unpublish or archive the event."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "capacity": 32,
                                "status": "published"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Event"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 42,
                                        "title": "Spring Round Robin",
                                        "slug": "spring-round-robin",
                                        "description": "<p>Doubles, all levels.</p>",
                                        "status": "published",
                                        "starts_at": "2026-03-14T15:00:00+00:00",
                                        "starts_at_local": "2026-03-14 10:00:00",
                                        "ends_at": "2026-03-14T18:00:00+00:00",
                                        "ends_at_local": "2026-03-14 13:00:00",
                                        "all_day": false,
                                        "category": {
                                            "id": 3,
                                            "name": "Tournaments"
                                        },
                                        "location": {
                                            "id": 2,
                                            "name": "Main hall"
                                        },
                                        "price": "25.00",
                                        "members_only": false,
                                        "capacity": 32,
                                        "registered_count": 18,
                                        "spots_left": 14,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "deleteEventsOne",
                "tags": [
                    "Events"
                ],
                "summary": "Delete an event",
                "description": "Deletes an event nobody has registered for. An event with registrations is refused, because their registrations and payments belong to it: set its `status` to `archived` instead.",
                "security": [
                    {
                        "apiKey": [
                            "events:write"
                        ]
                    }
                ],
                "x-required-scope": "events:write",
                "x-error-codes": [
                    "event_has_registrations"
                ],
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "description": "The event's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Done. No body."
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/events/{event}/registrations": {
            "get": {
                "operationId": "getEventsOneRegistrations",
                "tags": [
                    "Events"
                ],
                "summary": "List an event's registrations",
                "description": "Who registered, oldest first. `registrant` carries a name, email and phone only for a key that also holds `users:read`. Answers typed into the registration form are not returned.",
                "security": [
                    {
                        "apiKey": [
                            "events:read"
                        ]
                    }
                ],
                "x-required-scope": "events:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "description": "The event's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/EventRegistration"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 9001,
                                            "registrant": {
                                                "id": 1201,
                                                "name": "Jordan Lee",
                                                "email": "jordan@example.com",
                                                "phone": "555-0142"
                                            },
                                            "spots": 2,
                                            "amount_paid": "50.00",
                                            "checked_in_at": null,
                                            "registered_at": "2026-02-20T22:11:45+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/reservations": {
            "get": {
                "operationId": "getReservations",
                "tags": [
                    "Reservations"
                ],
                "summary": "List reservations",
                "description": "Bookings, earliest first. One entry per booking, with each court and time it holds under `slots`. Blocked time and waitlist entries are not bookings and are never listed. An unpaid booking still in a customer's cart is listed with `paid: false`; if the cart is abandoned it becomes `cancelled`.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:read"
                        ]
                    }
                ],
                "x-required-scope": "reservations:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active (the default), cancelled, or all.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "cancelled",
                                "all"
                            ]
                        },
                        "example": "active"
                    },
                    {
                        "name": "starts_from",
                        "in": "query",
                        "required": false,
                        "description": "Bookings starting on or after this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-01"
                    },
                    {
                        "name": "starts_to",
                        "in": "query",
                        "required": false,
                        "description": "Bookings starting on or before this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-31"
                    },
                    {
                        "name": "schedule_id",
                        "in": "query",
                        "required": false,
                        "description": "Only bookings on this schedule.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 7
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this customer's bookings.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1201
                    },
                    {
                        "name": "paid",
                        "in": "query",
                        "required": false,
                        "description": "true for paid bookings, false for unpaid.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        },
                        "example": "true"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Reservation"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 55210,
                                            "booking_id": 30114,
                                            "status": "active",
                                            "starts_at": "2026-03-14T23:00:00+00:00",
                                            "starts_at_local": "2026-03-14 18:00:00",
                                            "schedule": {
                                                "id": 7,
                                                "name": "Court schedule"
                                            },
                                            "customer": {
                                                "id": 1201,
                                                "name": "Jordan Lee",
                                                "email": "jordan@example.com",
                                                "phone": "555-0142"
                                            },
                                            "party_size": 4,
                                            "products": [
                                                {
                                                    "id": 15,
                                                    "name": "Court rental",
                                                    "quantity": 1
                                                }
                                            ],
                                            "slots": [
                                                {
                                                    "id": 55210,
                                                    "court": 3,
                                                    "starts_at": "2026-03-14T23:00:00+00:00",
                                                    "starts_at_local": "2026-03-14 18:00:00",
                                                    "duration_minutes": 60
                                                }
                                            ],
                                            "cost": "40.00",
                                            "paid": true,
                                            "created_at": "2026-01-12T16:04:09+00:00",
                                            "updated_at": "2026-02-02T19:30:00+00:00",
                                            "cancelled_at": null
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createReservations",
                "tags": [
                    "Reservations"
                ],
                "summary": "Create a reservation",
                "description": "Books a product for a customer, through the same rules as the club's booking page: capacity, opening hours, minimum notice and the product's booking window. The price is worked out by the server and returned as `cost`; you cannot send one. The booking is unpaid (`paid: false`): the API takes no payment, and the customer pays at the club or staff take payment in the admin. The customer is found by email or created, and becomes a member of the club. An existing account keeps the phone it has (the booking carries the phone you send), and a staff account is refused. The schedule's confirmation emails are sent unless you turn them off.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:write"
                        ]
                    }
                ],
                "x-required-scope": "reservations:write",
                "x-error-codes": [
                    "booking_not_supported",
                    "product_not_bookable",
                    "slot_unavailable",
                    "price_unavailable",
                    "duplicate_booking",
                    "booking_refused",
                    "customer_is_staff"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "schedule_id",
                                    "product_id",
                                    "starts_at_local",
                                    "customer"
                                ],
                                "properties": {
                                    "schedule_id": {
                                        "type": "integer",
                                        "description": "The schedule to book on, from a bookable product."
                                    },
                                    "product_id": {
                                        "type": "integer",
                                        "description": "The bookable product."
                                    },
                                    "starts_at_local": {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                                        "description": "When it starts, on the club's clock. One of the product's open times."
                                    },
                                    "duration_minutes": {
                                        "type": "integer",
                                        "description": "One of the product's `duration_options`. Its `duration_minutes` unless given."
                                    },
                                    "party_size": {
                                        "type": "integer",
                                        "description": "How many people. 1 unless given."
                                    },
                                    "send_confirmation": {
                                        "type": "boolean",
                                        "description": "Whether the schedule's confirmation emails go to the customer and staff. True unless given."
                                    },
                                    "customer": {
                                        "type": "object",
                                        "required": [
                                            "first_name",
                                            "last_name",
                                            "email",
                                            "phone"
                                        ],
                                        "properties": {
                                            "first_name": {
                                                "type": "string",
                                                "description": "First name."
                                            },
                                            "last_name": {
                                                "type": "string",
                                                "description": "Last name."
                                            },
                                            "email": {
                                                "type": "string",
                                                "description": "Email address. An existing account with it is used."
                                            },
                                            "phone": {
                                                "type": "string",
                                                "description": "Phone number for this booking. An existing account's phone is not changed."
                                            }
                                        },
                                        "additionalProperties": false,
                                        "description": "Who the booking is for."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "schedule_id": 7,
                                "product_id": 15,
                                "starts_at_local": "2026-03-14 18:00",
                                "duration_minutes": 60,
                                "party_size": 4,
                                "send_confirmation": true,
                                "customer": {
                                    "first_name": "Jordan",
                                    "last_name": "Lee",
                                    "email": "jordan@example.com",
                                    "phone": "555-0142"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Reservation"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 55210,
                                        "booking_id": 30114,
                                        "status": "active",
                                        "starts_at": "2026-03-14T23:00:00+00:00",
                                        "starts_at_local": "2026-03-14 18:00:00",
                                        "schedule": {
                                            "id": 7,
                                            "name": "Court schedule"
                                        },
                                        "customer": {
                                            "id": 1201,
                                            "name": "Jordan Lee",
                                            "email": "jordan@example.com",
                                            "phone": "555-0142"
                                        },
                                        "party_size": 4,
                                        "products": [
                                            {
                                                "id": 15,
                                                "name": "Court rental",
                                                "quantity": 1
                                            }
                                        ],
                                        "slots": [
                                            {
                                                "id": 55210,
                                                "court": 3,
                                                "starts_at": "2026-03-14T23:00:00+00:00",
                                                "starts_at_local": "2026-03-14 18:00:00",
                                                "duration_minutes": 60
                                            }
                                        ],
                                        "cost": "40.00",
                                        "paid": true,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00",
                                        "cancelled_at": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/reservations/{reservation}": {
            "get": {
                "operationId": "getReservationsOne",
                "tags": [
                    "Reservations"
                ],
                "summary": "Get a reservation",
                "description": "One booking by id, active or cancelled.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:read"
                        ]
                    }
                ],
                "x-required-scope": "reservations:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "reservation",
                        "in": "path",
                        "required": true,
                        "description": "The reservation's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Reservation"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 55210,
                                        "booking_id": 30114,
                                        "status": "active",
                                        "starts_at": "2026-03-14T23:00:00+00:00",
                                        "starts_at_local": "2026-03-14 18:00:00",
                                        "schedule": {
                                            "id": 7,
                                            "name": "Court schedule"
                                        },
                                        "customer": {
                                            "id": 1201,
                                            "name": "Jordan Lee",
                                            "email": "jordan@example.com",
                                            "phone": "555-0142"
                                        },
                                        "party_size": 4,
                                        "products": [
                                            {
                                                "id": 15,
                                                "name": "Court rental",
                                                "quantity": 1
                                            }
                                        ],
                                        "slots": [
                                            {
                                                "id": 55210,
                                                "court": 3,
                                                "starts_at": "2026-03-14T23:00:00+00:00",
                                                "starts_at_local": "2026-03-14 18:00:00",
                                                "duration_minutes": 60
                                            }
                                        ],
                                        "cost": "40.00",
                                        "paid": true,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00",
                                        "cancelled_at": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "deleteReservationsOne",
                "tags": [
                    "Reservations"
                ],
                "summary": "Cancel a reservation",
                "description": "Cancels an unpaid booking, every court and time it holds, and answers with it as `cancelled`. No cancellation email is sent. A booking with any payment is refused: its refund is worked out in the club admin, and the API moves no money. To move a booking, cancel it and book the new time. Cancelling a cancelled booking changes nothing.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:write"
                        ]
                    }
                ],
                "x-required-scope": "reservations:write",
                "x-error-codes": [
                    "reservation_paid"
                ],
                "parameters": [
                    {
                        "name": "reservation",
                        "in": "path",
                        "required": true,
                        "description": "The reservation's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Reservation"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 55210,
                                        "booking_id": 30114,
                                        "status": "active",
                                        "starts_at": "2026-03-14T23:00:00+00:00",
                                        "starts_at_local": "2026-03-14 18:00:00",
                                        "schedule": {
                                            "id": 7,
                                            "name": "Court schedule"
                                        },
                                        "customer": {
                                            "id": 1201,
                                            "name": "Jordan Lee",
                                            "email": "jordan@example.com",
                                            "phone": "555-0142"
                                        },
                                        "party_size": 4,
                                        "products": [
                                            {
                                                "id": 15,
                                                "name": "Court rental",
                                                "quantity": 1
                                            }
                                        ],
                                        "slots": [
                                            {
                                                "id": 55210,
                                                "court": 3,
                                                "starts_at": "2026-03-14T23:00:00+00:00",
                                                "starts_at_local": "2026-03-14 18:00:00",
                                                "duration_minutes": 60
                                            }
                                        ],
                                        "cost": "40.00",
                                        "paid": true,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00",
                                        "cancelled_at": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookable-products": {
            "get": {
                "operationId": "getBookableProducts",
                "tags": [
                    "Reservations"
                ],
                "summary": "List bookable products",
                "description": "What `POST /reservations` can book: the products the club's booking page offers a customer who is not signed in. Private and staff-only products, sign-in-only schedules, cart and pay-before-reserving schedules and multi-part packages are booked in the club admin and are not listed. Empty for a club whose bookings cannot be made through the API yet.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:read"
                        ]
                    }
                ],
                "x-required-scope": "reservations:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "schedule_id",
                        "in": "query",
                        "required": false,
                        "description": "Only products booked on this schedule.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 7
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/BookableProduct"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 15,
                                            "name": "Court rental",
                                            "schedule": {
                                                "id": 7,
                                                "name": "Court schedule"
                                            },
                                            "duration_minutes": 60,
                                            "duration_options": [
                                                60,
                                                90
                                            ],
                                            "min_party_size": 2,
                                            "max_party_size": 8
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookable-products/{product}/open-times": {
            "get": {
                "operationId": "getBookableProductsOneOpenTimes",
                "tags": [
                    "Reservations"
                ],
                "summary": "List a product's open times",
                "description": "The times a product can still be booked on one club day, as the booking page would offer them: capacity, opening hours, the schedule's minimum notice and the product's booking window are applied. A time can be taken between this call and the booking.",
                "security": [
                    {
                        "apiKey": [
                            "reservations:read"
                        ]
                    }
                ],
                "x-required-scope": "reservations:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "required": true,
                        "description": "The bookable product's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": true,
                        "description": "The club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-14"
                    },
                    {
                        "name": "party_size",
                        "in": "query",
                        "required": false,
                        "description": "How many people. 1 unless given.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 4
                    },
                    {
                        "name": "duration_minutes",
                        "in": "query",
                        "required": false,
                        "description": "One of the product's `duration_options`. Its `duration_minutes` unless given.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 60
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/OpenTimes"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "product_id": 15,
                                        "schedule_id": 7,
                                        "date": "2026-03-14",
                                        "duration_minutes": 60,
                                        "party_size": 4,
                                        "starts_at_local": [
                                            "2026-03-14 18:00:00",
                                            "2026-03-14 19:00:00"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/leagues": {
            "get": {
                "operationId": "getLeagues",
                "tags": [
                    "Leagues"
                ],
                "summary": "List leagues",
                "description": "The club's leagues, oldest first. Tournaments are not leagues and are not listed.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:read"
                        ]
                    }
                ],
                "x-required-scope": "leagues:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active (the default), archived, or all.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "archived",
                                "all"
                            ]
                        },
                        "example": "active"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/League"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 310,
                                            "name": "Tuesday Night Doubles",
                                            "url": "tuesday-night-doubles",
                                            "league_type_id": 4,
                                            "league_format": "standard",
                                            "scoring_format": "classic",
                                            "day_of_week": "Tuesday",
                                            "starts_on": "2026-03-03",
                                            "ends_on": "2026-05-19",
                                            "archived": false,
                                            "description": "<p>Eight weeks plus playoffs.</p>",
                                            "price": "45.00",
                                            "taxable": true,
                                            "team_limit": 12,
                                            "created_at": "2026-01-12T16:04:09+00:00",
                                            "updated_at": "2026-02-02T19:30:00+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createLeagues",
                "tags": [
                    "Leagues"
                ],
                "summary": "Create a league",
                "description": "Creates the league itself, as the Create League form in the club admin does. Teams, divisions, the schedule and the sign-up form are added in the admin.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:write"
                        ]
                    }
                ],
                "x-required-scope": "leagues:write",
                "x-error-codes": [],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "name",
                                    "league_type_id",
                                    "team_limit"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "The league's name."
                                    },
                                    "league_type_id": {
                                        "type": "integer",
                                        "description": "One of the club's league types, as `league_type_id` on its other leagues."
                                    },
                                    "team_limit": {
                                        "type": "integer",
                                        "description": "How many teams the league takes. Fixed once the league exists."
                                    },
                                    "scoring_format": {
                                        "type": "string",
                                        "enum": [
                                            "classic",
                                            "best_of"
                                        ],
                                        "description": "`classic` unless given. Fixed once the league exists."
                                    },
                                    "starts_on": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First day of the season."
                                    },
                                    "ends_on": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Last day of the season. Not before the first."
                                    },
                                    "price": {
                                        "type": "integer",
                                        "description": "What a team or player pays, before tax: a whole number of the club's currency. 0 unless given."
                                    },
                                    "taxable": {
                                        "type": "boolean",
                                        "description": "Whether the club's tax is added at checkout. True unless given."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "The public description, as HTML. Scripts and other unsafe markup are removed."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "name": "Tuesday Night Doubles",
                                "league_type_id": 4,
                                "team_limit": 12,
                                "scoring_format": "classic",
                                "starts_on": "2026-03-03",
                                "ends_on": "2026-05-19",
                                "price": 45,
                                "taxable": true,
                                "description": "<p>Eight weeks plus playoffs.</p>"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/League"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 310,
                                        "name": "Tuesday Night Doubles",
                                        "url": "tuesday-night-doubles",
                                        "league_type_id": 4,
                                        "league_format": "standard",
                                        "scoring_format": "classic",
                                        "day_of_week": "Tuesday",
                                        "starts_on": "2026-03-03",
                                        "ends_on": "2026-05-19",
                                        "archived": false,
                                        "description": "<p>Eight weeks plus playoffs.</p>",
                                        "price": "45.00",
                                        "taxable": true,
                                        "team_limit": 12,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/leagues/{league}": {
            "get": {
                "operationId": "getLeaguesOne",
                "tags": [
                    "Leagues"
                ],
                "summary": "Get a league",
                "description": "One league by id.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:read"
                        ]
                    }
                ],
                "x-required-scope": "leagues:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "league",
                        "in": "path",
                        "required": true,
                        "description": "The league's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/League"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 310,
                                        "name": "Tuesday Night Doubles",
                                        "url": "tuesday-night-doubles",
                                        "league_type_id": 4,
                                        "league_format": "standard",
                                        "scoring_format": "classic",
                                        "day_of_week": "Tuesday",
                                        "starts_on": "2026-03-03",
                                        "ends_on": "2026-05-19",
                                        "archived": false,
                                        "description": "<p>Eight weeks plus playoffs.</p>",
                                        "price": "45.00",
                                        "taxable": true,
                                        "team_limit": 12,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "operationId": "updateLeaguesOne",
                "tags": [
                    "Leagues"
                ],
                "summary": "Update a league",
                "description": "Changes the fields you send and leaves the rest. The scoring format and team limit are fixed once a league exists, and scores are entered in the admin or by players, not here.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:write"
                        ]
                    }
                ],
                "x-required-scope": "leagues:write",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "league",
                        "in": "path",
                        "required": true,
                        "description": "The league's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "The league's name."
                                    },
                                    "league_type_id": {
                                        "type": "integer",
                                        "description": "One of the club's league types, as `league_type_id` on its other leagues."
                                    },
                                    "starts_on": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First day of the season."
                                    },
                                    "ends_on": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Last day of the season. Not before the first."
                                    },
                                    "price": {
                                        "type": "integer",
                                        "description": "What a team or player pays, before tax: a whole number of the club's currency."
                                    },
                                    "taxable": {
                                        "type": "boolean",
                                        "description": "Whether the club's tax is added at checkout."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "The public description, as HTML. Scripts and other unsafe markup are removed."
                                    },
                                    "archived": {
                                        "type": "boolean",
                                        "description": "Archive the league, or bring it back."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "ends_on": "2026-05-19",
                                "price": 45
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/League"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 310,
                                        "name": "Tuesday Night Doubles",
                                        "url": "tuesday-night-doubles",
                                        "league_type_id": 4,
                                        "league_format": "standard",
                                        "scoring_format": "classic",
                                        "day_of_week": "Tuesday",
                                        "starts_on": "2026-03-03",
                                        "ends_on": "2026-05-19",
                                        "archived": false,
                                        "description": "<p>Eight weeks plus playoffs.</p>",
                                        "price": "45.00",
                                        "taxable": true,
                                        "team_limit": 12,
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/leagues/{league}/teams": {
            "get": {
                "operationId": "getLeaguesOneTeams",
                "tags": [
                    "Leagues"
                ],
                "summary": "List a league's teams",
                "description": "Teams by name, each with its roster. A player carries a name, email and phone only for a key that also holds `users:read`.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:read"
                        ]
                    }
                ],
                "x-required-scope": "leagues:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "league",
                        "in": "path",
                        "required": true,
                        "description": "The league's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LeagueTeam"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 880,
                                            "name": "Net Gains",
                                            "url": "net-gains",
                                            "paid": true,
                                            "checked_in": false,
                                            "players": [
                                                {
                                                    "id": 1201,
                                                    "name": "Jordan Lee",
                                                    "email": "jordan@example.com",
                                                    "phone": "555-0142",
                                                    "captain": true
                                                }
                                            ]
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/leagues/{league}/games": {
            "get": {
                "operationId": "getLeaguesOneGames",
                "tags": [
                    "Leagues"
                ],
                "summary": "List a league's games",
                "description": "The schedule and results, earliest first. Each game is the same object the league webhooks send.",
                "security": [
                    {
                        "apiKey": [
                            "leagues:read"
                        ]
                    }
                ],
                "x-required-scope": "leagues:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "league",
                        "in": "path",
                        "required": true,
                        "description": "The league's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "name": "scheduled_from",
                        "in": "query",
                        "required": false,
                        "description": "Games on or after this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-01"
                    },
                    {
                        "name": "scheduled_to",
                        "in": "query",
                        "required": false,
                        "description": "Games on or before this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-31"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Game"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 71002,
                                            "league_id": 310,
                                            "type": "game",
                                            "is_bye": false,
                                            "scheduled_at": "2026-03-03T23:30:00+00:00",
                                            "scheduled_at_local": "2026-03-03 18:30:00",
                                            "location": {
                                                "id": 2,
                                                "name": "Court 2"
                                            },
                                            "display_location": "Court 2",
                                            "status": "scheduled",
                                            "division_id": null,
                                            "home_team": {
                                                "id": 880,
                                                "name": "Net Gains",
                                                "url": "net-gains"
                                            },
                                            "away_team": {
                                                "id": 881,
                                                "name": "Dink Dynasty",
                                                "url": "dink-dynasty"
                                            },
                                            "home_score": "11",
                                            "away_score": "7",
                                            "winning_team_id": 880,
                                            "losing_team_id": 881,
                                            "message": null,
                                            "has_conflict": false,
                                            "series": {
                                                "home_wins": 2,
                                                "away_wins": 1
                                            },
                                            "match_scores": [
                                                {
                                                    "match_number": 1,
                                                    "home": "11",
                                                    "away": "9"
                                                }
                                            ],
                                            "updated_at": "2026-03-04T01:02:03+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/users": {
            "get": {
                "operationId": "getUsers",
                "tags": [
                    "Users"
                ],
                "summary": "List users",
                "description": "The club's members, by id. Deleted accounts are never returned.",
                "security": [
                    {
                        "apiKey": [
                            "users:read"
                        ]
                    }
                ],
                "x-required-scope": "users:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active (the default), archived (removed from the club), or all.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "archived",
                                "all"
                            ]
                        },
                        "example": "active"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Part of a name, email or phone number (at least 2 characters).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "jordan"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/User"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1201,
                                            "first_name": "Jordan",
                                            "last_name": "Lee",
                                            "email": "jordan@example.com",
                                            "phone": "555-0142",
                                            "status": "active",
                                            "role": "member",
                                            "banned": false,
                                            "email_opt_in": true,
                                            "sms_opt_in": false,
                                            "joined_at": "2025-09-02T17:20:00+00:00",
                                            "created_at": "2026-01-12T16:04:09+00:00",
                                            "updated_at": "2026-02-02T19:30:00+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createUsers",
                "tags": [
                    "Users"
                ],
                "summary": "Add a user",
                "description": "Makes the person with this email a member of the club and answers with the member. Accounts are shared by every club a person uses, so the email may already have one. A new account is `201` and has no password until the person sets one. An existing account is added to the club as it is (`201`): the name and phone you send are not written over details the person entered, and the answer carries only its `id`, `email` and membership, with `first_name`, `last_name`, `phone` and the opt-ins null. Someone who is already a member is answered `200` and not changed, except that a member the club had archived becomes active again. A ban is never lifted here. A staff account is refused.",
                "security": [
                    {
                        "apiKey": [
                            "users:write"
                        ]
                    }
                ],
                "x-required-scope": "users:write",
                "x-error-codes": [
                    "email_in_use",
                    "user_is_staff"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email",
                                    "first_name",
                                    "last_name"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email address. It decides whether an account already exists."
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "description": "First name, for a new account."
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Last name, for a new account."
                                    },
                                    "phone": {
                                        "anyOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "Phone number, for a new account."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "email": "jordan@example.com",
                                "first_name": "Jordan",
                                "last_name": "Lee",
                                "phone": "555-0142"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1201,
                                        "first_name": "Jordan",
                                        "last_name": "Lee",
                                        "email": "jordan@example.com",
                                        "phone": "555-0142",
                                        "status": "active",
                                        "role": "member",
                                        "banned": false,
                                        "email_opt_in": true,
                                        "sms_opt_in": false,
                                        "joined_at": "2025-09-02T17:20:00+00:00",
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/users/{user}": {
            "get": {
                "operationId": "getUsersOne",
                "tags": [
                    "Users"
                ],
                "summary": "Get a user",
                "description": "One member by id.",
                "security": [
                    {
                        "apiKey": [
                            "users:read"
                        ]
                    }
                ],
                "x-required-scope": "users:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "description": "The user's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1201,
                                        "first_name": "Jordan",
                                        "last_name": "Lee",
                                        "email": "jordan@example.com",
                                        "phone": "555-0142",
                                        "status": "active",
                                        "role": "member",
                                        "banned": false,
                                        "email_opt_in": true,
                                        "sms_opt_in": false,
                                        "joined_at": "2025-09-02T17:20:00+00:00",
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "operationId": "updateUsersOne",
                "tags": [
                    "Users"
                ],
                "summary": "Update a user",
                "description": "Changes a member's name and phone number. Nothing a person signs in with can be changed through the API: not the email, the username or the password. A staff account (an owner or anyone with a staff role, at this club or another) is refused, and so is a person who also uses a club outside this one's group: their details are shared with that club.",
                "security": [
                    {
                        "apiKey": [
                            "users:write"
                        ]
                    }
                ],
                "x-required-scope": "users:write",
                "x-error-codes": [
                    "user_is_staff",
                    "user_is_shared"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "description": "The user's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    },
                    {
                        "$ref": "#/components/parameters/idempotency_key"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "description": "First name."
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Last name."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Phone number."
                                    }
                                },
                                "additionalProperties": false
                            },
                            "example": {
                                "phone": "555-0142"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1201,
                                        "first_name": "Jordan",
                                        "last_name": "Lee",
                                        "email": "jordan@example.com",
                                        "phone": "555-0142",
                                        "status": "active",
                                        "role": "member",
                                        "banned": false,
                                        "email_opt_in": true,
                                        "sms_opt_in": false,
                                        "joined_at": "2025-09-02T17:20:00+00:00",
                                        "created_at": "2026-01-12T16:04:09+00:00",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sales": {
            "get": {
                "operationId": "getSales",
                "tags": [
                    "Sales"
                ],
                "summary": "List sales",
                "description": "Invoices with their line items, oldest first. `customer` carries a name, email and phone only for a key that also holds `users:read`.",
                "security": [
                    {
                        "apiKey": [
                            "sales:read"
                        ]
                    }
                ],
                "x-required-scope": "sales:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Sales made on or after this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Sales made on or before this club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-31"
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "required": false,
                        "description": "Only sales paid this way.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "card_online",
                                "refund",
                                "check",
                                "no_payment",
                                "pay_later",
                                "cash",
                                "card_logged",
                                "gift_card",
                                "card_swipe",
                                "card_saved",
                                "donation",
                                "other",
                                "ach",
                                "card_saved_pos",
                                "failed"
                            ]
                        },
                        "example": "cash"
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this customer's sales.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1201
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records changed at or after this time (ISO-8601; UTC when no offset is given). Use it to sync changes.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "example": "2026-01-31T14:00:00Z"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Sale"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 88410,
                                            "payment_method": "card_online",
                                            "payment_status": "confirmed",
                                            "customer": {
                                                "id": 1201,
                                                "name": "Jordan Lee",
                                                "email": "jordan@example.com",
                                                "phone": "555-0142"
                                            },
                                            "subtotal": "50.00",
                                            "tax": "4.00",
                                            "fees": "0.00",
                                            "total": "54.00",
                                            "coupon_code": null,
                                            "items": [
                                                {
                                                    "id": 140233,
                                                    "type": "reservation",
                                                    "item_id": 55210,
                                                    "quantity": 1,
                                                    "amount": "50.00",
                                                    "tax": "4.00",
                                                    "discount": "0.00"
                                                }
                                            ],
                                            "created_at": "2026-03-14T23:05:11+00:00",
                                            "created_at_local": "2026-03-14 18:05:11",
                                            "updated_at": "2026-02-02T19:30:00+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sales/{sale}": {
            "get": {
                "operationId": "getSalesOne",
                "tags": [
                    "Sales"
                ],
                "summary": "Get a sale",
                "description": "One invoice by id.",
                "security": [
                    {
                        "apiKey": [
                            "sales:read"
                        ]
                    }
                ],
                "x-required-scope": "sales:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "sale",
                        "in": "path",
                        "required": true,
                        "description": "The sale's id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 42
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Sale"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 88410,
                                        "payment_method": "card_online",
                                        "payment_status": "confirmed",
                                        "customer": {
                                            "id": 1201,
                                            "name": "Jordan Lee",
                                            "email": "jordan@example.com",
                                            "phone": "555-0142"
                                        },
                                        "subtotal": "50.00",
                                        "tax": "4.00",
                                        "fees": "0.00",
                                        "total": "54.00",
                                        "coupon_code": null,
                                        "items": [
                                            {
                                                "id": 140233,
                                                "type": "reservation",
                                                "item_id": 55210,
                                                "quantity": 1,
                                                "amount": "50.00",
                                                "tax": "4.00",
                                                "discount": "0.00"
                                            }
                                        ],
                                        "created_at": "2026-03-14T23:05:11+00:00",
                                        "created_at_local": "2026-03-14 18:05:11",
                                        "updated_at": "2026-02-02T19:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/reports/sales-summary": {
            "get": {
                "operationId": "getReportsSalesSummary",
                "tags": [
                    "Reports"
                ],
                "summary": "Sales summary",
                "description": "Totals for a range of club days (at most 92), by payment method and by day. The figures are plain sums of the invoices `/sales` lists: gross is every sale that is not a refund, a no-payment record or a failed payment; refunds are counted apart. They are not the admin Reporting dashboard's figures, which apply further rules for gift cards and register tickets. At an axe-throwing club, bookings paid on the online booking page are not invoices, so they are not in these totals: read them from `/reservations`. The answer is cached briefly: a range that includes today can be up to five minutes behind `/sales`.",
                "security": [
                    {
                        "apiKey": [
                            "reports:read"
                        ]
                    }
                ],
                "x-required-scope": "reports:read",
                "x-error-codes": [],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "First club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "Last club day.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-03-31"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SalesSummary"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "from": "2026-03-01",
                                        "to": "2026-03-31",
                                        "timezone": "America/Chicago",
                                        "currency": "USD",
                                        "gross_sales": "18250.00",
                                        "refunds": "310.00",
                                        "net_sales": "17940.00",
                                        "tax": "1351.85",
                                        "sale_count": 412,
                                        "refund_count": 6,
                                        "by_payment_method": [
                                            {
                                                "payment_method": "card_online",
                                                "sale_count": 301,
                                                "total": "14980.00"
                                            }
                                        ],
                                        "by_day": [
                                            {
                                                "date": "2026-03-14",
                                                "gross_sales": "912.50",
                                                "refunds": "0.00",
                                                "sale_count": 21
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "http",
                "scheme": "bearer",
                "description": "A club API key (it starts with sck_). Each operation lists the scope it needs: events:read, events:write, reservations:read, reservations:write, leagues:read, leagues:write, users:read, users:write, sales:read, reports:read."
            }
        },
        "parameters": {
            "idempotency_key": {
                "name": "Idempotency-Key",
                "in": "header",
                "required": false,
                "description": "Makes the write safe to retry: a second request with the same value and the same body (field order does not matter) gets the first answer back instead of running again. The same value with a different body is refused.",
                "schema": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9\\-_:.]+$"
                }
            },
            "page": {
                "name": "page",
                "in": "query",
                "description": "Which page, from 1.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            },
            "per_page": {
                "name": "per_page",
                "in": "query",
                "description": "Records per page.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25
                }
            }
        },
        "responses": {
            "Error": {
                "description": "Any failure. `error.code` is one of: unauthenticated, missing_scope, key_creator_lacks_access, ip_not_allowed, club_unavailable, browser_request_not_allowed, api_not_enabled, user_is_staff, customer_is_staff, user_is_shared, not_found, method_not_allowed, request_in_progress, event_has_registrations, email_in_use, booking_not_supported, product_not_bookable, slot_unavailable, price_unavailable, duplicate_booking, booking_refused, reservation_paid, validation_failed, idempotency_key_reused, invalid_idempotency_key, rate_limited, too_many_failed_attempts, server_error.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "Meta": {
                "type": "object",
                "required": [
                    "club",
                    "key"
                ],
                "properties": {
                    "club": {
                        "$ref": "#/components/schemas/Club",
                        "description": "The club this key belongs to. Every request works on this club and no other."
                    },
                    "key": {
                        "$ref": "#/components/schemas/Key",
                        "description": "The key that made the request."
                    }
                }
            },
            "Club": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "slug",
                    "timezone",
                    "currency"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The club's id.",
                        "examples": [
                            12
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "The club's name.",
                        "examples": [
                            "Northside Pickleball"
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "The club's address on the site.",
                        "examples": [
                            "northside-pickleball"
                        ]
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The club's timezone. Every `*_local` time and every date filter is on this clock.",
                        "examples": [
                            "America/Chicago"
                        ]
                    },
                    "currency": {
                        "type": "string",
                        "description": "The currency of every amount.",
                        "examples": [
                            "USD"
                        ]
                    }
                }
            },
            "Key": {
                "type": "object",
                "required": [
                    "name",
                    "prefix",
                    "scopes",
                    "expires_at"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The name staff gave the key.",
                        "examples": [
                            "Zapier"
                        ]
                    },
                    "prefix": {
                        "type": "string",
                        "description": "The first characters of the key, as shown in the admin.",
                        "examples": [
                            "sck_a1B2c3D4"
                        ]
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "The scopes the key was given. A `:write` scope also allows the `:read` of the same data.",
                        "examples": [
                            [
                                "events:read",
                                "reservations:write"
                            ]
                        ]
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the key stops working, or null if it does not expire."
                    }
                }
            },
            "Person": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "email",
                    "phone"
                ],
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The person's user id, or null for a guest with no account.",
                        "examples": [
                            1201
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "Jordan Lee"
                        ]
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "jordan@example.com"
                        ]
                    },
                    "phone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "555-0142"
                        ]
                    }
                }
            },
            "Named": {
                "type": "object",
                "required": [
                    "id",
                    "name"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Its id.",
                        "examples": [
                            7
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "Its name.",
                        "examples": [
                            "Court schedule"
                        ]
                    }
                }
            },
            "Event": {
                "type": "object",
                "required": [
                    "id",
                    "title",
                    "slug",
                    "description",
                    "status",
                    "starts_at",
                    "starts_at_local",
                    "ends_at",
                    "ends_at_local",
                    "all_day",
                    "category",
                    "location",
                    "price",
                    "members_only",
                    "capacity",
                    "registered_count",
                    "spots_left",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The event's id.",
                        "examples": [
                            42
                        ]
                    },
                    "title": {
                        "type": "string",
                        "description": "The event's title.",
                        "examples": [
                            "Spring Round Robin"
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "The event's address on the club's site.",
                        "examples": [
                            "spring-round-robin"
                        ]
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The public description, as HTML.",
                        "examples": [
                            "<p>Doubles, all levels.</p>"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "description": "published, unpublished, archived, or scheduled (set to publish later).",
                        "examples": [
                            "published"
                        ]
                    },
                    "starts_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it starts (UTC).",
                        "examples": [
                            "2026-03-14T15:00:00+00:00"
                        ]
                    },
                    "starts_at_local": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it starts, on the club's clock.",
                        "examples": [
                            "2026-03-14 10:00:00"
                        ]
                    },
                    "ends_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it ends (UTC).",
                        "examples": [
                            "2026-03-14T18:00:00+00:00"
                        ]
                    },
                    "ends_at_local": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it ends, on the club's clock.",
                        "examples": [
                            "2026-03-14 13:00:00"
                        ]
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "True when the event has no start time, only a day.",
                        "examples": [
                            false
                        ]
                    },
                    "category": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/Named"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Its category, if it has one.",
                        "examples": [
                            {
                                "id": 3,
                                "name": "Tournaments"
                            }
                        ]
                    },
                    "location": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/Named"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Where it is held, if set.",
                        "examples": [
                            {
                                "id": 2,
                                "name": "Main hall"
                            }
                        ]
                    },
                    "price": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The base price. An event with several ticket types can charge other amounts.",
                        "examples": [
                            "25.00"
                        ]
                    },
                    "members_only": {
                        "type": "boolean",
                        "description": "True when only members can register.",
                        "examples": [
                            false
                        ]
                    },
                    "capacity": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spots available, or null when unlimited.",
                        "examples": [
                            32
                        ]
                    },
                    "registered_count": {
                        "type": "integer",
                        "description": "Spots taken.",
                        "examples": [
                            18
                        ]
                    },
                    "spots_left": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spots still open, or null when unlimited.",
                        "examples": [
                            14
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record was created (UTC).",
                        "examples": [
                            "2026-01-12T16:04:09+00:00"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record last changed (UTC).",
                        "examples": [
                            "2026-02-02T19:30:00+00:00"
                        ]
                    }
                }
            },
            "EventRegistration": {
                "type": "object",
                "required": [
                    "id",
                    "registrant",
                    "spots",
                    "amount_paid",
                    "checked_in_at",
                    "registered_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The registration's id.",
                        "examples": [
                            9001
                        ]
                    },
                    "registrant": {
                        "$ref": "#/components/schemas/Person",
                        "description": "Who registered."
                    },
                    "spots": {
                        "type": "integer",
                        "description": "Spots this registration holds.",
                        "examples": [
                            2
                        ]
                    },
                    "amount_paid": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "What has been paid for it.",
                        "examples": [
                            "50.00"
                        ]
                    },
                    "checked_in_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the registrant was checked in (UTC), or null."
                    },
                    "registered_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When they registered (UTC).",
                        "examples": [
                            "2026-02-20T22:11:45+00:00"
                        ]
                    }
                }
            },
            "Reservation": {
                "type": "object",
                "required": [
                    "id",
                    "booking_id",
                    "status",
                    "starts_at",
                    "starts_at_local",
                    "schedule",
                    "customer",
                    "party_size",
                    "products",
                    "slots",
                    "cost",
                    "paid",
                    "created_at",
                    "updated_at",
                    "cancelled_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The reservation's id.",
                        "examples": [
                            55210
                        ]
                    },
                    "booking_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The id shared by every slot of this booking, or null for a single-slot booking that has none.",
                        "examples": [
                            30114
                        ]
                    },
                    "status": {
                        "type": "string",
                        "description": "active or cancelled.",
                        "examples": [
                            "active"
                        ]
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the earliest slot starts (UTC).",
                        "examples": [
                            "2026-03-14T23:00:00+00:00"
                        ]
                    },
                    "starts_at_local": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                        "description": "When the earliest slot starts, on the club's clock.",
                        "examples": [
                            "2026-03-14 18:00:00"
                        ]
                    },
                    "schedule": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/Named"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The schedule it was booked on.",
                        "examples": [
                            {
                                "id": 7,
                                "name": "Court schedule"
                            }
                        ]
                    },
                    "customer": {
                        "$ref": "#/components/schemas/Person",
                        "description": "Who the booking is for."
                    },
                    "party_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Players or lanes as booked. What the number counts depends on the product.",
                        "examples": [
                            4
                        ]
                    },
                    "products": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/BookedProduct"
                        },
                        "description": "What was booked."
                    },
                    "slots": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ReservationSlot"
                        },
                        "description": "Each court and time the booking holds."
                    },
                    "cost": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The booking's cost.",
                        "examples": [
                            "40.00"
                        ]
                    },
                    "paid": {
                        "type": "boolean",
                        "description": "Whether the booking is marked paid. It is a mark, not a balance: a booking paid by deposit stays marked paid while the rest is still owed.",
                        "examples": [
                            true
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record was created (UTC).",
                        "examples": [
                            "2026-01-12T16:04:09+00:00"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record last changed (UTC).",
                        "examples": [
                            "2026-02-02T19:30:00+00:00"
                        ]
                    },
                    "cancelled_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it was cancelled (UTC), or null."
                    }
                }
            },
            "BookedProduct": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "quantity"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The product's id.",
                        "examples": [
                            15
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "The product's name.",
                        "examples": [
                            "Court rental"
                        ]
                    },
                    "quantity": {
                        "type": "integer",
                        "description": "How many were booked.",
                        "examples": [
                            1
                        ]
                    }
                }
            },
            "BookableProduct": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "schedule",
                    "duration_minutes",
                    "duration_options",
                    "min_party_size",
                    "max_party_size"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The product's id: the `product_id` of a booking.",
                        "examples": [
                            15
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "The product's name.",
                        "examples": [
                            "Court rental"
                        ]
                    },
                    "schedule": {
                        "$ref": "#/components/schemas/Named",
                        "description": "The schedule it is booked on: the `schedule_id` of a booking.",
                        "examples": [
                            {
                                "id": 7,
                                "name": "Court schedule"
                            }
                        ]
                    },
                    "duration_minutes": {
                        "type": "integer",
                        "description": "How long a booking is unless another length is asked for.",
                        "examples": [
                            60
                        ]
                    },
                    "duration_options": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Every length it can be booked for, in minutes.",
                        "examples": [
                            [
                                60,
                                90
                            ]
                        ]
                    },
                    "min_party_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The smallest party it takes, or null for no minimum.",
                        "examples": [
                            2
                        ]
                    },
                    "max_party_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The largest party it takes, or null for no maximum.",
                        "examples": [
                            8
                        ]
                    }
                }
            },
            "OpenTimes": {
                "type": "object",
                "required": [
                    "product_id",
                    "schedule_id",
                    "date",
                    "duration_minutes",
                    "party_size",
                    "starts_at_local"
                ],
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "description": "The product asked about.",
                        "examples": [
                            15
                        ]
                    },
                    "schedule_id": {
                        "type": "integer",
                        "description": "The schedule it is booked on.",
                        "examples": [
                            7
                        ]
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "The club day asked about.",
                        "examples": [
                            "2026-03-14"
                        ]
                    },
                    "duration_minutes": {
                        "type": "integer",
                        "description": "The booking length the times are for.",
                        "examples": [
                            60
                        ]
                    },
                    "party_size": {
                        "type": "integer",
                        "description": "The party size the times are for.",
                        "examples": [
                            4
                        ]
                    },
                    "starts_at_local": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                        },
                        "description": "Every start still open, on the club's clock. Empty when the day is full, closed or past.",
                        "examples": [
                            [
                                "2026-03-14 18:00:00",
                                "2026-03-14 19:00:00"
                            ]
                        ]
                    }
                }
            },
            "ReservationSlot": {
                "type": "object",
                "required": [
                    "id",
                    "court",
                    "starts_at",
                    "starts_at_local",
                    "duration_minutes"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The slot's id.",
                        "examples": [
                            55210
                        ]
                    },
                    "court": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The court or lane number.",
                        "examples": [
                            3
                        ]
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the slot starts (UTC).",
                        "examples": [
                            "2026-03-14T23:00:00+00:00"
                        ]
                    },
                    "starts_at_local": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                        "description": "When the slot starts, on the club's clock.",
                        "examples": [
                            "2026-03-14 18:00:00"
                        ]
                    },
                    "duration_minutes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "How long the slot is.",
                        "examples": [
                            60
                        ]
                    }
                }
            },
            "League": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "url",
                    "league_type_id",
                    "league_format",
                    "scoring_format",
                    "day_of_week",
                    "starts_on",
                    "ends_on",
                    "archived",
                    "description",
                    "price",
                    "taxable",
                    "team_limit",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The league's id.",
                        "examples": [
                            310
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "The league's name.",
                        "examples": [
                            "Tuesday Night Doubles"
                        ]
                    },
                    "url": {
                        "type": "string",
                        "description": "The league's address on the club's site.",
                        "examples": [
                            "tuesday-night-doubles"
                        ]
                    },
                    "league_type_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The id of the club's league type (sport or category).",
                        "examples": [
                            4
                        ]
                    },
                    "league_format": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "standard, individual_rotate, flex or individual.",
                        "examples": [
                            "standard"
                        ]
                    },
                    "scoring_format": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "classic, best_of, golf or axe_throwing.",
                        "examples": [
                            "classic"
                        ]
                    },
                    "day_of_week": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The day it plays, if it has one.",
                        "examples": [
                            "Tuesday"
                        ]
                    },
                    "starts_on": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "First day of the season.",
                        "examples": [
                            "2026-03-03"
                        ]
                    },
                    "ends_on": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Last day of the season.",
                        "examples": [
                            "2026-05-19"
                        ]
                    },
                    "archived": {
                        "type": "boolean",
                        "description": "True once the league is archived.",
                        "examples": [
                            false
                        ]
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The public description, as HTML.",
                        "examples": [
                            "<p>Eight weeks plus playoffs.</p>"
                        ]
                    },
                    "price": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "What a team or player pays, before tax.",
                        "examples": [
                            "45.00"
                        ]
                    },
                    "taxable": {
                        "type": "boolean",
                        "description": "Whether the club's tax is added at checkout.",
                        "examples": [
                            true
                        ]
                    },
                    "team_limit": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "How many teams the league takes.",
                        "examples": [
                            12
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record was created (UTC).",
                        "examples": [
                            "2026-01-12T16:04:09+00:00"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record last changed (UTC).",
                        "examples": [
                            "2026-02-02T19:30:00+00:00"
                        ]
                    }
                }
            },
            "LeagueTeam": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "url",
                    "paid",
                    "checked_in",
                    "players"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The team's id.",
                        "examples": [
                            880
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "The team's name.",
                        "examples": [
                            "Net Gains"
                        ]
                    },
                    "url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The team's address on the site.",
                        "examples": [
                            "net-gains"
                        ]
                    },
                    "paid": {
                        "type": "boolean",
                        "description": "Whether the team has paid for this league.",
                        "examples": [
                            true
                        ]
                    },
                    "checked_in": {
                        "type": "boolean",
                        "description": "Whether the team is checked in.",
                        "examples": [
                            false
                        ]
                    },
                    "players": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Player"
                        },
                        "description": "The roster."
                    }
                }
            },
            "Player": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "email",
                    "phone",
                    "captain"
                ],
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The player's user id.",
                        "examples": [
                            1201
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "Jordan Lee"
                        ]
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "jordan@example.com"
                        ]
                    },
                    "phone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Only with `users:read`.",
                        "examples": [
                            "555-0142"
                        ]
                    },
                    "captain": {
                        "type": "boolean",
                        "description": "True for the team's captain.",
                        "examples": [
                            true
                        ]
                    }
                }
            },
            "Game": {
                "type": "object",
                "required": [
                    "id",
                    "league_id",
                    "type",
                    "is_bye",
                    "scheduled_at",
                    "scheduled_at_local",
                    "location",
                    "display_location",
                    "status",
                    "division_id",
                    "home_team",
                    "away_team",
                    "home_score",
                    "away_score",
                    "winning_team_id",
                    "losing_team_id",
                    "message",
                    "has_conflict",
                    "series",
                    "match_scores",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The game's id.",
                        "examples": [
                            71002
                        ]
                    },
                    "league_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The league it belongs to.",
                        "examples": [
                            310
                        ]
                    },
                    "type": {
                        "type": "string",
                        "description": "game, bye, or message (a note on the schedule).",
                        "examples": [
                            "game"
                        ]
                    },
                    "is_bye": {
                        "type": "boolean",
                        "description": "True when a team has the week off.",
                        "examples": [
                            false
                        ]
                    },
                    "scheduled_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it is played (UTC).",
                        "examples": [
                            "2026-03-03T23:30:00+00:00"
                        ]
                    },
                    "scheduled_at_local": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When it is played, on the club's clock.",
                        "examples": [
                            "2026-03-03 18:30:00"
                        ]
                    },
                    "location": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GameLocation"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The court."
                    },
                    "display_location": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Where players are told the game is.",
                        "examples": [
                            "Court 2"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "description": "scheduled, canceled or forfeit.",
                        "examples": [
                            "scheduled"
                        ]
                    },
                    "division_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Its division, if the league has them."
                    },
                    "home_team": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GameTeam"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The home team.",
                        "examples": [
                            {
                                "id": 880,
                                "name": "Net Gains",
                                "url": "net-gains"
                            }
                        ]
                    },
                    "away_team": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GameTeam"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The away team.",
                        "examples": [
                            {
                                "id": 881,
                                "name": "Dink Dynasty",
                                "url": "dink-dynasty"
                            }
                        ]
                    },
                    "home_score": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The home score, as entered. A string, because some formats write more than a number.",
                        "examples": [
                            "11"
                        ]
                    },
                    "away_score": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The away score, as entered.",
                        "examples": [
                            "7"
                        ]
                    },
                    "winning_team_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The winner, once decided.",
                        "examples": [
                            880
                        ]
                    },
                    "losing_team_id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The loser, once decided.",
                        "examples": [
                            881
                        ]
                    },
                    "message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "A note staff put on the game."
                    },
                    "has_conflict": {
                        "type": "boolean",
                        "description": "True when the schedule flags a conflict for this game.",
                        "examples": [
                            false
                        ]
                    },
                    "series": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/Series"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Matches won by each side. Only for best_of scoring; null otherwise."
                    },
                    "match_scores": {
                        "anyOf": [
                            {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/MatchScore"
                                }
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Each match's score. Only for best_of scoring; null otherwise."
                    },
                    "updated_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the game last changed (UTC).",
                        "examples": [
                            "2026-03-04T01:02:03+00:00"
                        ]
                    }
                }
            },
            "GameLocation": {
                "type": "object",
                "required": [
                    "id",
                    "name"
                ],
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The court's id, or null when only a label was typed.",
                        "examples": [
                            2
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The court's name.",
                        "examples": [
                            "Court 2"
                        ]
                    }
                }
            },
            "GameTeam": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "url"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The team's id.",
                        "examples": [
                            880
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The team's name.",
                        "examples": [
                            "Net Gains"
                        ]
                    },
                    "url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The team's address on the site.",
                        "examples": [
                            "net-gains"
                        ]
                    }
                }
            },
            "Series": {
                "type": "object",
                "required": [
                    "home_wins",
                    "away_wins"
                ],
                "properties": {
                    "home_wins": {
                        "type": "integer",
                        "description": "Matches the home team won.",
                        "examples": [
                            2
                        ]
                    },
                    "away_wins": {
                        "type": "integer",
                        "description": "Matches the away team won.",
                        "examples": [
                            1
                        ]
                    }
                }
            },
            "MatchScore": {
                "type": "object",
                "required": [
                    "match_number",
                    "home",
                    "away"
                ],
                "properties": {
                    "match_number": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Which match of the series.",
                        "examples": [
                            1
                        ]
                    },
                    "home": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The home score.",
                        "examples": [
                            "11"
                        ]
                    },
                    "away": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The away score.",
                        "examples": [
                            "9"
                        ]
                    }
                }
            },
            "User": {
                "type": "object",
                "required": [
                    "id",
                    "first_name",
                    "last_name",
                    "email",
                    "phone",
                    "status",
                    "role",
                    "banned",
                    "email_opt_in",
                    "sms_opt_in",
                    "joined_at",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The user's id.",
                        "examples": [
                            1201
                        ]
                    },
                    "first_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "First name.",
                        "examples": [
                            "Jordan"
                        ]
                    },
                    "last_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Last name.",
                        "examples": [
                            "Lee"
                        ]
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Email address.",
                        "examples": [
                            "jordan@example.com"
                        ]
                    },
                    "phone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Phone number.",
                        "examples": [
                            "555-0142"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "description": "active, or archived once removed from the club.",
                        "examples": [
                            "active"
                        ]
                    },
                    "role": {
                        "type": "string",
                        "description": "admin for club staff, otherwise member.",
                        "examples": [
                            "member"
                        ]
                    },
                    "banned": {
                        "type": "boolean",
                        "description": "True while the club has banned the member.",
                        "examples": [
                            false
                        ]
                    },
                    "email_opt_in": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Whether the member accepts marketing email. Honour it. Null when withheld (see POST /users): treat as no.",
                        "examples": [
                            true
                        ]
                    },
                    "sms_opt_in": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Whether the member accepts text messages. Honour it. Null when withheld (see POST /users): treat as no.",
                        "examples": [
                            false
                        ]
                    },
                    "joined_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When they joined the club (UTC).",
                        "examples": [
                            "2025-09-02T17:20:00+00:00"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record was created (UTC).",
                        "examples": [
                            "2026-01-12T16:04:09+00:00"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record last changed (UTC).",
                        "examples": [
                            "2026-02-02T19:30:00+00:00"
                        ]
                    }
                }
            },
            "Sale": {
                "type": "object",
                "required": [
                    "id",
                    "payment_method",
                    "payment_status",
                    "customer",
                    "subtotal",
                    "tax",
                    "fees",
                    "total",
                    "coupon_code",
                    "items",
                    "created_at",
                    "created_at_local",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The sale's id.",
                        "examples": [
                            88410
                        ]
                    },
                    "payment_method": {
                        "type": "string",
                        "description": "How it was paid: card_online, refund, check, no_payment, pay_later, cash, card_logged, gift_card, card_swipe, card_saved, donation, other, ach, card_saved_pos, failed.",
                        "examples": [
                            "card_online"
                        ]
                    },
                    "payment_status": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The payment's state, such as confirmed or pending.",
                        "examples": [
                            "confirmed"
                        ]
                    },
                    "customer": {
                        "$ref": "#/components/schemas/Person",
                        "description": "Who bought."
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Before tax and fees.",
                        "examples": [
                            "50.00"
                        ]
                    },
                    "tax": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Tax.",
                        "examples": [
                            "4.00"
                        ]
                    },
                    "fees": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Fees charged to the customer.",
                        "examples": [
                            "0.00"
                        ]
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "What the sale came to. A refund can be negative.",
                        "examples": [
                            "54.00"
                        ]
                    },
                    "coupon_code": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The coupon used, if any."
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SaleItem"
                        },
                        "description": "The lines of the sale."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the sale was made (UTC).",
                        "examples": [
                            "2026-03-14T23:05:11+00:00"
                        ]
                    },
                    "created_at_local": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                        "description": "When the sale was made, on the club's clock.",
                        "examples": [
                            "2026-03-14 18:05:11"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the record last changed (UTC).",
                        "examples": [
                            "2026-02-02T19:30:00+00:00"
                        ]
                    }
                }
            },
            "SaleItem": {
                "type": "object",
                "required": [
                    "id",
                    "type",
                    "item_id",
                    "quantity",
                    "amount",
                    "tax",
                    "discount"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The line's id.",
                        "examples": [
                            140233
                        ]
                    },
                    "type": {
                        "type": "string",
                        "description": "What was sold: reservation, membership, product, event, league and so on.",
                        "examples": [
                            "reservation"
                        ]
                    },
                    "item_id": {
                        "type": "integer",
                        "description": "The id of the thing sold, of that type.",
                        "examples": [
                            55210
                        ]
                    },
                    "quantity": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "How many.",
                        "examples": [
                            1
                        ]
                    },
                    "amount": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The line's amount.",
                        "examples": [
                            "50.00"
                        ]
                    },
                    "tax": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Tax on the line.",
                        "examples": [
                            "4.00"
                        ]
                    },
                    "discount": {
                        "anyOf": [
                            {
                                "type": "string",
                                "pattern": "^-?\\d+\\.\\d{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Discount taken off the line.",
                        "examples": [
                            "0.00"
                        ]
                    }
                }
            },
            "SalesSummary": {
                "type": "object",
                "required": [
                    "from",
                    "to",
                    "timezone",
                    "currency",
                    "gross_sales",
                    "refunds",
                    "net_sales",
                    "tax",
                    "sale_count",
                    "refund_count",
                    "by_payment_method",
                    "by_day"
                ],
                "properties": {
                    "from": {
                        "type": "string",
                        "format": "date",
                        "description": "First club day covered.",
                        "examples": [
                            "2026-03-01"
                        ]
                    },
                    "to": {
                        "type": "string",
                        "format": "date",
                        "description": "Last club day covered.",
                        "examples": [
                            "2026-03-31"
                        ]
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The clock the days are on.",
                        "examples": [
                            "America/Chicago"
                        ]
                    },
                    "currency": {
                        "type": "string",
                        "description": "The currency of every amount.",
                        "examples": [
                            "USD"
                        ]
                    },
                    "gross_sales": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Every sale that is not a refund, a no-payment record or a failed payment.",
                        "examples": [
                            "18250.00"
                        ]
                    },
                    "refunds": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Refunds, as a positive amount.",
                        "examples": [
                            "310.00"
                        ]
                    },
                    "net_sales": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "gross_sales less refunds.",
                        "examples": [
                            "17940.00"
                        ]
                    },
                    "tax": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Tax on the lines of the sales in gross_sales.",
                        "examples": [
                            "1351.85"
                        ]
                    },
                    "sale_count": {
                        "type": "integer",
                        "description": "Sales in gross_sales.",
                        "examples": [
                            412
                        ]
                    },
                    "refund_count": {
                        "type": "integer",
                        "description": "Refunds.",
                        "examples": [
                            6
                        ]
                    },
                    "by_payment_method": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PaymentMethodTotal"
                        },
                        "description": "gross_sales split by how it was paid."
                    },
                    "by_day": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DayTotal"
                        },
                        "description": "One entry per club day that had a sale or a refund."
                    }
                }
            },
            "PaymentMethodTotal": {
                "type": "object",
                "required": [
                    "payment_method",
                    "sale_count",
                    "total"
                ],
                "properties": {
                    "payment_method": {
                        "type": "string",
                        "description": "How the sales were paid.",
                        "examples": [
                            "card_online"
                        ]
                    },
                    "sale_count": {
                        "type": "integer",
                        "description": "Sales paid this way.",
                        "examples": [
                            301
                        ]
                    },
                    "total": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Their total.",
                        "examples": [
                            "14980.00"
                        ]
                    }
                }
            },
            "DayTotal": {
                "type": "object",
                "required": [
                    "date",
                    "gross_sales",
                    "refunds",
                    "sale_count"
                ],
                "properties": {
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "The club day.",
                        "examples": [
                            "2026-03-14"
                        ]
                    },
                    "gross_sales": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Sales that day.",
                        "examples": [
                            "912.50"
                        ]
                    },
                    "refunds": {
                        "type": "string",
                        "pattern": "^-?\\d+\\.\\d{2}$",
                        "description": "Refunds that day.",
                        "examples": [
                            "0.00"
                        ]
                    },
                    "sale_count": {
                        "type": "integer",
                        "description": "Sales that day.",
                        "examples": [
                            21
                        ]
                    }
                }
            },
            "PageMeta": {
                "type": "object",
                "required": [
                    "page",
                    "per_page",
                    "has_more"
                ],
                "properties": {
                    "page": {
                        "type": "integer",
                        "description": "The page returned."
                    },
                    "per_page": {
                        "type": "integer",
                        "description": "Records per page."
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "True when another page follows."
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message",
                            "status"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "unauthenticated",
                                    "missing_scope",
                                    "key_creator_lacks_access",
                                    "ip_not_allowed",
                                    "club_unavailable",
                                    "browser_request_not_allowed",
                                    "api_not_enabled",
                                    "user_is_staff",
                                    "customer_is_staff",
                                    "user_is_shared",
                                    "not_found",
                                    "method_not_allowed",
                                    "request_in_progress",
                                    "event_has_registrations",
                                    "email_in_use",
                                    "booking_not_supported",
                                    "product_not_bookable",
                                    "slot_unavailable",
                                    "price_unavailable",
                                    "duplicate_booking",
                                    "booking_refused",
                                    "reservation_paid",
                                    "validation_failed",
                                    "idempotency_key_reused",
                                    "invalid_idempotency_key",
                                    "rate_limited",
                                    "too_many_failed_attempts",
                                    "server_error"
                                ],
                                "description": "What went wrong. Stable: write code against this."
                            },
                            "message": {
                                "type": "string",
                                "description": "The same, for a person. May be reworded."
                            },
                            "status": {
                                "type": "integer",
                                "description": "The HTTP status."
                            },
                            "request_id": {
                                "type": "string",
                                "description": "Identifies the request in our logs. Also sent as X-Request-Id."
                            },
                            "fields": {
                                "type": "object",
                                "description": "On validation_failed: each rejected parameter or body field and why.",
                                "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}