{
  "openapi": "3.1.1",
  "info": {
    "title": "Business Management",
    "version": "2.0.0",
    "termsOfService": "https://alteg.io/en/info/terms/",
    "license": {
      "name": "Altegio API Agreement",
      "url": "/en/api-license-agreement"
    },
    "description": "## Start here: get your credentials\n\nBusiness Management requests use a **Partner Token** and, when business data\nis involved, a **User Token**:\n\n1. Open the [Altegio Marketplace](https://app.alteg.io/appstore/developers/1)\n   and click **Developer account**. Complete the developer registration. Your\n   Partner Token then appears automatically under **Account settings → Account\n   details**.\n2. Choose how you will obtain the User Token:\n   - **Application system user:** create an application in Developer Account.\n     Under **API Access**, enter the system user's **User ID**, save it, copy the\n     generated **User Token**, and configure the application's credentials,\n     access rights, and connection settings. Then [install and activate the\n     application on a test Location](../developers/marketplace-quickstart.md).\n     The token can access that Location only after the installation is active.\n   - **Your own Business User:** call the [v1 user authorization\n     endpoint](../b2b-v1/openapi.yaml#tag/Authentication/operation/authorize_user) with\n     your Altegio login and password. Use `data.user_token` from the response.\n     No application installation is needed, but that Business User must already\n     have access to the Location.\n3. Send both values in the same header:\n\n   `Authorization: Bearer <partner_token>, User <user_token>`\n\nAn application's system user and your own Business User can have different\nLocations and permissions. A request that works with one token may therefore\nreturn `403` with the other. See [How to Get API Keys](../get-api-key.md) for the\ncomplete beginner walkthrough.\n\nNext-generation B2B API with improved design and consistency.\n\n**Base URL:** `https://api.alteg.io/api/v2`\n\n## Status\n\nThis API is in active development. New features and improvements are released here first.\nWe recommend using this API for all new integrations.\n\n## Required Media Type\n\nEvery request must include:\n```\nAccept: application/vnd.api.v2+json\n```\n\nRequests without the v2 media type return `400`. A charset parameter is accepted.\n\n## URL Patterns\n\nLocation-scoped resources use `/locations/{location_id}/...`.\n\nPositions and Tags preserve the literal `company_id` path parameter name for\nSDK compatibility, but its value is the Location identifier. The legacy\n`/companies/{company_id}/positions` and `/companies/{company_id}/tags` paths\nremain accepted as compatibility aliases.\n\nLegacy path segments are accepted as compatibility aliases of the canonical ones:\n`companies` (`locations`), `staff` (`team_members`), `records` (`appointments`),\n`activities` (`events`), `goods` (`products`), `good_categories` (`product_categories`),\n`attendance_good_items` (`attendance_product_items`), and `salon_groups` (`chains`).\nA request through a legacy segment reaches the same handler and additionally returns\n`Deprecation: @1782864000` (2026-07-01T00:00:00Z), `Sunset: Mon, 01 Mar 2027 00:00:00 GMT`,\nand `Link: <https://developer.alteg.io/en/b2b-v3/openapi>; rel=\"deprecation\"`\n([RFC 9745](https://www.rfc-editor.org/rfc/rfc9745),\n[RFC 8594](https://www.rfc-editor.org/rfc/rfc8594)). Canonical URLs do not return these headers.\n\n## Parameter aliases\n\nUse canonical names such as `location_id`, `chain_id`, `team_member_id`,\n`appointment_id`, and `product_id` for top-level query-string and request-body\nparameters. V2 accepts the corresponding legacy names in both directions for\ncompatibility, but canonical names are recommended for new integrations.\n\nAlias expansion is not recursive: nested request fields must use the literal names shown\nby each endpoint. Responses are not transformed and retain their literal wire fields and\nJSON:API resource type values; response schemas and examples show those exact names.\n"
  },
  "servers": [
    {
      "url": "https://api.alteg.io/api/v2",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerPartnerUser": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Bearer {PartnerToken}, User {UserToken}"
      }
    },
    "parameters": {
      "accept_header": {
        "name": "Accept",
        "in": "header",
        "description": "Required B2B v2 response media type. Use `application/vnd.api.v2+json`. A charset parameter is also accepted.\n",
        "required": true,
        "schema": {
          "type": "string",
          "default": "application/vnd.api.v2+json"
        },
        "example": "application/vnd.api.v2+json"
      }
    },
    "schemas": {
      "resourceIdentifier": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "toManyRelationship": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/resourceIdentifier"
            }
          }
        }
      },
      "toOneRelationship": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/resourceIdentifier"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "service_resource": {
        "title": "Service Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "service",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Service ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "category_id"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "Service name"
              },
              "category_id": {
                "type": "integer",
                "description": "Service Category ID"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "resources": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "service_composite": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "resource_links": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "company_links": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "trial_settings": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        },
        "$defs": {
          "resourceIdentifier": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "toManyRelationship": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/resourceIdentifier"
                }
              }
            }
          },
          "toOneRelationship": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/resourceIdentifier"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "includedResource": {
            "type": "object",
            "required": [
              "type",
              "id",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "attributes": {
                "type": "object"
              },
              "relationships": {
                "type": "object"
              }
            }
          }
        }
      },
      "includedResource": {
        "type": "object",
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "type": "object"
          },
          "relationships": {
            "type": "object"
          }
        }
      },
      "error_response": {
        "title": "B2B v2 Error Response",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data",
          "meta"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "data": {
            "type": "null"
          },
          "meta": {
            "type": "object",
            "required": [
              "message"
            ],
            "additionalProperties": true,
            "properties": {
              "message": {
                "type": "string"
              },
              "errors": {
                "type": "object",
                "description": "Field-level validation errors, when applicable",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "service_category_resource": {
        "title": "Service Category Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "service_category",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Service Category ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "salon_service_id"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "Service Category name"
              },
              "salon_service_id": {
                "type": "integer",
                "description": "Location-specific Service Category link ID"
              }
            }
          }
        }
      },
      "attendance_service_resource": {
        "title": "Attendance Service Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "attendance_service",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Compound Attendance Service identifier"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "company_id",
              "service_id",
              "category_id",
              "is_composite",
              "composite_service_id",
              "salon_service_id",
              "composite_position",
              "staff_id",
              "title",
              "length",
              "duration",
              "price_min",
              "price_max",
              "technical_break_duration"
            ],
            "properties": {
              "company_id": {
                "type": "integer",
                "description": "Location ID"
              },
              "service_id": {
                "type": "integer",
                "description": "Service ID"
              },
              "category_id": {
                "type": "integer",
                "description": "Service Category ID"
              },
              "is_composite": {
                "type": "boolean",
                "description": "Whether the Service is composite"
              },
              "composite_service_id": {
                "type": "integer",
                "description": "Parent composite Service ID, or `0`"
              },
              "salon_service_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Location-specific Service link ID"
              },
              "composite_position": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Position within a composite Service"
              },
              "staff_id": {
                "type": "integer",
                "description": "Team Member ID, or `0` when not Team Member-specific"
              },
              "title": {
                "type": "string",
                "description": "Service name"
              },
              "length": {
                "type": "integer",
                "minimum": 0,
                "deprecated": true,
                "description": "Deprecated duration in seconds; use `duration`"
              },
              "duration": {
                "type": "integer",
                "minimum": 0,
                "description": "Service duration in seconds"
              },
              "price_min": {
                "type": "number",
                "description": "Minimum Service price"
              },
              "price_max": {
                "type": "number",
                "description": "Maximum Service price"
              },
              "technical_break_duration": {
                "type": "integer",
                "minimum": 0,
                "description": "Technical break duration in seconds"
              }
            }
          }
        }
      },
      "pagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page",
          "offset",
          "limit"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 250
          }
        }
      },
      "attendance_service_suggestion_resource": {
        "title": "Attendance Service Suggestion Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "attendance_service_suggestion",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Suggested Service ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "service_id",
              "suggestion_type",
              "record_id"
            ],
            "properties": {
              "service_id": {
                "type": "integer",
                "description": "Suggested Service ID"
              },
              "suggestion_type": {
                "type": "string",
                "enum": [
                  "last_client_visit_attendance_service",
                  "client_popular_service",
                  "master_popular_service"
                ],
                "description": "Suggestion reason. Enum values are literal wire values; `client`\nidentifies a Booking User and `master` identifies a Team Member.\n"
              },
              "record_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Source Appointment ID when the suggestion is based on a prior visit"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "attendance_service": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "record": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Appointment relationship. `record` is the literal wire relationship name."
              }
            }
          }
        }
      },
      "unit_resource": {
        "title": "Product Unit Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "unit",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Product Unit ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "company_id",
              "title",
              "short_title"
            ],
            "properties": {
              "company_id": {
                "type": "integer",
                "minimum": 0,
                "description": "Location ID for a custom Unit; `0` for a shared system Unit"
              },
              "title": {
                "type": "string",
                "description": "Full Unit name"
              },
              "short_title": {
                "type": "string",
                "description": "Abbreviated Unit name"
              }
            }
          }
        }
      },
      "product_resource": {
        "title": "Product Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "good",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Product ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "category_id",
              "title",
              "sale_unit_id",
              "consumable_unit_id",
              "sale_unit_to_consumable_unit_ratio",
              "loyalty_abonement_type_id",
              "loyalty_certificate_type_id",
              "cost",
              "actual_cost",
              "is_chain"
            ],
            "properties": {
              "category_id": {
                "type": "integer",
                "description": "Product Category ID"
              },
              "title": {
                "type": "string",
                "description": "Product name"
              },
              "sale_unit_id": {
                "type": "integer",
                "description": "Sale Unit ID"
              },
              "consumable_unit_id": {
                "type": "integer",
                "description": "Consumable Unit ID"
              },
              "sale_unit_to_consumable_unit_ratio": {
                "type": "number",
                "description": "Number of Consumable Units in one Sale Unit"
              },
              "loyalty_abonement_type_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Membership type ID, when the Product represents a membership"
              },
              "loyalty_certificate_type_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Gift card type ID, when the Product represents a gift card"
              },
              "cost": {
                "type": "number",
                "description": "Product sale price"
              },
              "actual_cost": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current Product cost when `actual_cost` is requested and the Business\nUser has permission to view it; otherwise `null`.\n"
              },
              "is_chain": {
                "type": "boolean",
                "description": "Whether the Product belongs to the Chain catalog"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "loyalty_abonement_type": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "loyalty_certificate_type": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "mark_settings": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "storage_amounts": {
                "$ref": "#/components/schemas/toManyRelationship"
              }
            }
          }
        }
      },
      "storage_amount_resource": {
        "title": "Product Storage Amount Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "good_storage_amount",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Composite Product and Storage ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "good_id",
              "storage_id",
              "sale_amount",
              "consumable_amount"
            ],
            "properties": {
              "good_id": {
                "type": "integer",
                "description": "Product ID"
              },
              "storage_id": {
                "type": "integer",
                "description": "Storage ID"
              },
              "sale_amount": {
                "type": "number",
                "description": "Available amount measured in Sale Units"
              },
              "consumable_amount": {
                "type": "number",
                "description": "Available amount measured in Consumable Units"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "storage": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        }
      },
      "product_category_resource": {
        "title": "Product Category Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "good_category",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Product Category ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "is_chain",
              "parent_category_id"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "Product Category name"
              },
              "is_chain": {
                "type": "boolean",
                "description": "Whether the Product Category belongs to the Chain catalog"
              },
              "parent_category_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Parent Product Category ID; `null` for a root category"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "child_categories": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "goods": {
                "$ref": "#/components/schemas/toManyRelationship",
                "description": "Product relationships. `goods` is the literal wire relationship name."
              }
            }
          }
        }
      },
      "attendance_product_item_resource": {
        "title": "Appointment Product Item Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "attendance_good_item",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Appointment Product Item ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "record_id",
              "quantity",
              "unit_id",
              "sale_unit_id",
              "consumable_unit_id",
              "operation_unit_type",
              "operation_type_slug",
              "first_cost",
              "manual_cost",
              "cost_per_unit",
              "discount_percent",
              "cost",
              "master_id",
              "staff_id",
              "good_id",
              "storage_id"
            ],
            "properties": {
              "record_id": {
                "type": "integer",
                "description": "Appointment ID; `record_id` is the literal wire field"
              },
              "quantity": {
                "type": "number",
                "description": "Product quantity"
              },
              "unit_id": {
                "type": "integer",
                "description": "Operation Unit ID"
              },
              "sale_unit_id": {
                "type": "integer",
                "description": "Sale Unit ID"
              },
              "consumable_unit_id": {
                "type": "integer",
                "description": "Consumable Unit ID"
              },
              "operation_unit_type": {
                "type": [
                  "string",
                  "null"
                ],
                "deprecated": true,
                "description": "Deprecated wire field; use `operation_type_slug`"
              },
              "operation_type_slug": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Unit operation type"
              },
              "first_cost": {
                "type": "number",
                "description": "Product cost before Appointment item adjustments"
              },
              "manual_cost": {
                "type": "number",
                "description": "Manually specified Product cost"
              },
              "cost_per_unit": {
                "type": "number",
                "description": "Product cost per unit"
              },
              "discount_percent": {
                "type": "number",
                "description": "Applied discount percentage"
              },
              "cost": {
                "type": "number",
                "description": "Final Product cost"
              },
              "master_id": {
                "type": "integer",
                "deprecated": true,
                "description": "Deprecated Team Member ID wire alias; use `staff_id`"
              },
              "staff_id": {
                "type": "integer",
                "description": "Team Member ID"
              },
              "good_id": {
                "type": "integer",
                "description": "Product ID"
              },
              "storage_id": {
                "type": "integer",
                "description": "Storage ID"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "good": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Product relationship. `good` is the literal wire relationship name."
              },
              "staff": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Team Member relationship. `staff` is the literal wire relationship name."
              },
              "storage_amount": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "loyalty_abonement": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "loyalty_certificate": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "marks": {
                "$ref": "#/components/schemas/toManyRelationship"
              }
            }
          }
        }
      },
      "team_member_resource": {
        "title": "Team Member Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "staff",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Team Member ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "tt_markup",
              "specialization",
              "image",
              "position_id",
              "is_available_as_assistant"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Team Member name"
              },
              "tt_markup": {
                "type": "integer",
                "description": "Schedule grid interval value"
              },
              "specialization": {
                "type": "string",
                "description": "Team Member specialization"
              },
              "image": {
                "type": "string",
                "description": "Team Member image URL"
              },
              "position_id": {
                "type": "integer",
                "description": "Position ID"
              },
              "is_available_as_assistant": {
                "type": "boolean",
                "description": "Whether the Team Member is available as an assistant"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "position": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "employee": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        }
      },
      "position_resource": {
        "title": "Position Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "staff_position",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Position ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "Position title"
              }
            }
          }
        }
      },
      "employment_profile_resource": {
        "title": "Employment Profile Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "employee",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Employment profile ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "phone",
              "name",
              "firstname",
              "surname",
              "patronymic",
              "date_admission",
              "date_registration_end",
              "citizenship",
              "gender",
              "passport_data",
              "personal_tax_reference_number",
              "number_insurance_certificates"
            ],
            "properties": {
              "phone": {
                "type": "string",
                "description": "Phone number"
              },
              "name": {
                "type": "string",
                "description": "Display name"
              },
              "firstname": {
                "type": "string",
                "description": "First name"
              },
              "surname": {
                "type": "string",
                "description": "Last name"
              },
              "patronymic": {
                "type": "string",
                "description": "Patronymic"
              },
              "date_admission": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Employment start date and time without a timezone"
              },
              "date_registration_end": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Registration end date and time without a timezone"
              },
              "citizenship": {
                "type": "string",
                "description": "Citizenship"
              },
              "gender": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2
                ],
                "description": "Gender wire value: `0` unspecified, `1` male, `2` female"
              },
              "passport_data": {
                "type": "string",
                "description": "Passport data"
              },
              "personal_tax_reference_number": {
                "type": "string",
                "description": "Personal tax reference number"
              },
              "number_insurance_certificates": {
                "type": "string",
                "description": "Insurance certificate number"
              }
            }
          }
        }
      },
      "team_member_position_resource": {
        "title": "Position Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "position",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Position ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "chain_id",
              "title",
              "description",
              "services_binding_type",
              "rules_required_fields",
              "only_chain_appointment",
              "salon_ids"
            ],
            "properties": {
              "chain_id": {
                "type": "integer",
                "description": "Chain ID"
              },
              "title": {
                "type": "string",
                "description": "Position title"
              },
              "description": {
                "type": "string",
                "description": "Position description"
              },
              "services_binding_type": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2
                ],
                "description": "Service binding mode:\n- `0` - disabled\n- `1` - soft\n- `2` - strict\n"
              },
              "rules_required_fields": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Required rule fields"
              },
              "only_chain_appointment": {
                "type": "boolean",
                "description": "Whether the Position is available only for Chain Appointments"
              },
              "salon_ids": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "Location IDs linked to the Position"
              }
            }
          }
        }
      },
      "attendance_include": {
        "title": "Attendance Appointment Includes",
        "description": "Includes accepted by the attendance operations. They extend the Appointment\nincludes with the nested includes needed to read back every key that\n[Save Visit Appointments](#tag/Appointments/operation/save_attendance_appointments)\nrequires. Values are literal API keys.\n",
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "string",
          "enum": [
            "client",
            "client.custom_field_values",
            "staff",
            "services",
            "goods",
            "resource_instances",
            "labels",
            "attendance_service_items",
            "attendance_service_items.assistants",
            "attendance_service_items.attendance_service_composite.composite_service",
            "attendance_good_items",
            "attendance_good_items.good",
            "attendance_good_items.staff",
            "attendance_good_items.marks",
            "attendance_good_items.loyalty_abonement",
            "attendance_good_items.loyalty_certificate",
            "attendance_document",
            "transactions",
            "fast_payment_settings",
            "acceptance_free",
            "custom_field_values",
            "comer",
            "client_notification_settings",
            "client_schedule",
            "duration_details"
          ]
        }
      },
      "appointment_resource": {
        "title": "Appointment Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "record",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Appointment ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "company_id",
              "external_id",
              "visit_id",
              "booking_user_id",
              "bookform_id",
              "master_id",
              "staff_id",
              "client_id",
              "comer_id",
              "source",
              "attendance",
              "attendance_status",
              "attendance_status_slug",
              "client_fictive_name",
              "client_fictive_phone",
              "client_fictive_email",
              "clients_count",
              "activity_id",
              "custom_color",
              "custom_font_color",
              "length",
              "duration",
              "paid_full",
              "is_paid",
              "is_overpaid",
              "timestamp",
              "date",
              "created_datetime",
              "from_url",
              "is_mobile",
              "comment",
              "prepaid_status",
              "record_from",
              "payment_status",
              "is_sale_bill_printed",
              "is_client_notification_sent"
            ],
            "properties": {
              "company_id": {
                "type": "integer",
                "description": "Location ID"
              },
              "external_id": {
                "type": "string",
                "description": "External Appointment ID"
              },
              "visit_id": {
                "type": "integer",
                "description": "Linked visit ID, or `0` when not linked"
              },
              "booking_user_id": {
                "type": "integer",
                "description": "Booking User account ID, or `0`"
              },
              "bookform_id": {
                "type": "integer",
                "description": "Booking form ID, or `0`"
              },
              "master_id": {
                "type": "integer",
                "deprecated": true,
                "description": "Deprecated wire field for Team Member ID; use `staff_id`"
              },
              "staff_id": {
                "type": "integer",
                "description": "Team Member ID"
              },
              "client_id": {
                "type": "integer",
                "description": "Booking User profile ID, or `0` when absent"
              },
              "comer_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Walk-in visitor ID"
              },
              "source": {
                "type": "integer",
                "description": "Appointment source wire value"
              },
              "attendance": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1,
                  2
                ],
                "description": "Deprecated attendance wire value; use `attendance_status_slug`"
              },
              "attendance_status": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1,
                  2
                ],
                "description": "Deprecated attendance status; use `attendance_status_slug`"
              },
              "attendance_status_slug": {
                "type": "string",
                "enum": [
                  "absent",
                  "waiting",
                  "attended",
                  "confirmed"
                ],
                "description": "Appointment attendance status"
              },
              "client_fictive_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Fallback Booking User name stored on the Appointment"
              },
              "client_fictive_phone": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Fallback Booking User phone stored on the Appointment"
              },
              "client_fictive_email": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Fallback Booking User email stored on the Appointment"
              },
              "clients_count": {
                "type": "integer",
                "minimum": 1,
                "description": "Number of Booking Users in the Appointment"
              },
              "activity_id": {
                "type": "integer",
                "description": "Event ID, or `0` when the Appointment is not part of an Event"
              },
              "custom_color": {
                "type": "string",
                "description": "Appointment background color without `#`, or an empty string"
              },
              "custom_font_color": {
                "type": "string",
                "description": "Appointment text color without `#`, or an empty string"
              },
              "length": {
                "type": "integer",
                "minimum": 0,
                "description": "Deprecated duration in seconds; use `duration`"
              },
              "duration": {
                "type": "integer",
                "minimum": 0,
                "description": "Appointment duration in seconds"
              },
              "paid_full": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2
                ],
                "description": "Deprecated payment wire value; use `is_paid` and `is_overpaid`"
              },
              "is_paid": {
                "type": "boolean",
                "description": "Whether the Appointment is fully paid"
              },
              "is_overpaid": {
                "type": "boolean",
                "description": "Whether the Appointment is overpaid"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64",
                "description": "Appointment start as a Unix timestamp"
              },
              "date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Appointment start in the Location timezone, without an offset"
              },
              "created_datetime": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Creation date and time in the Location timezone, without an offset"
              },
              "from_url": {
                "type": "string",
                "description": "Source URL, or an empty string"
              },
              "is_mobile": {
                "type": "integer",
                "description": "Mobile-origin wire status"
              },
              "comment": {
                "type": "string",
                "description": "Appointment comment"
              },
              "prepaid_status": {
                "type": "integer",
                "description": "Prepayment status wire value"
              },
              "record_from": {
                "type": "string",
                "description": "Human-readable Appointment source, or an empty string"
              },
              "payment_status": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Membership auto-payment status, when available"
              },
              "is_sale_bill_printed": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Whether the sale bill is printed, when available"
              },
              "is_client_notification_sent": {
                "type": "boolean",
                "description": "Whether a Booking User notification was sent"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "client": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "staff": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Team Member relationship. `staff` is the literal wire relationship name."
              },
              "services": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "goods": {
                "$ref": "#/components/schemas/toManyRelationship",
                "description": "Product relationships. `goods` is the literal wire relationship name."
              },
              "resource_instances": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "labels": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "attendance_service_items": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "attendance_good_items": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "attendance_document": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "transactions": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "fast_payment_settings": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "acceptance_free": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "custom_field_values": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "comer": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "client_notification_settings": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "client_schedule": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "duration_details": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        }
      },
      "serviceItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "service_id",
          "quantity",
          "cost_per_unit",
          "manual_cost",
          "discount_percent"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Appointment Service line ID; `null` creates a line"
          },
          "service_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Service ID"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 15000,
            "description": "Number of Service units"
          },
          "cost_per_unit": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Unit price before discount"
          },
          "manual_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Line total after `discount_percent`. It must match\n`cost_per_unit × quantity × (100 − discount_percent) / 100`;\notherwise the request returns `400`.\n"
          },
          "discount_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Discount in percent"
          },
          "composite_service_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Composite Service ID when the line belongs to a composite Service.\nRead it from\n`attendance_service_items.attendance_service_composite.composite_service`.\n"
          }
        }
      },
      "productItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "good_id",
          "unit_id",
          "storage_id",
          "staff_id",
          "operation_unit_type",
          "number",
          "planned_activation_date",
          "marks",
          "quantity",
          "cost_per_unit",
          "manual_cost",
          "discount_percent"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Appointment Product Item ID. `null` creates a line. An ID that does\nnot belong to this Appointment returns `422`.\n"
          },
          "good_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Product ID; `good_id` is the literal wire field."
          },
          "unit_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Unit ID. Echo the read's `unit_id`; for a new line send the Product's\nsale unit. The stored unit always comes from the Product.\n"
          },
          "storage_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Inventory ID to write the Product off from; `storage_id` is the literal wire field."
          },
          "staff_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Team Member ID credited with the sale; `staff_id` is the literal wire\nfield. The web app uses the Appointment's Team Member.\n"
          },
          "operation_unit_type": {
            "type": "string",
            "enum": [
              "sale",
              "consumable"
            ],
            "description": "`sale` sells the Product to the Booking User; `consumable` writes it\noff as a Service consumable. Echo the read's `operation_type_slug`.\n"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 32,
            "description": "Gift card or membership number. Required for a gift card unless its\ntype allows an empty code, and for an existing gift card or\nmembership line, where it must equal the read's\n`loyalty_certificate.number` or `loyalty_abonement.number`. `null`\nfor plain Products.\n"
          },
          "planned_activation_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Planned membership activation date (`YYYY-MM-DD`). Required when the\nmembership type expires on a specific date. Echo the read's\n`loyalty_abonement.planned_activation_date`; `null` for other lines.\n"
          },
          "marks": {
            "type": "array",
            "description": "Goods marking codes for the line. Echo the read's `marks`; send `[]`\nwhen the Product is not marked.\n",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "quantity": {
            "type": "number",
            "minimum": 0.001,
            "maximum": 1000000000,
            "description": "Quantity in sale units, as a positive number. Echo the read's\n`quantity`.\n"
          },
          "cost_per_unit": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Unit price before discount. For a new line, the Product's sale price."
          },
          "manual_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Line total after `discount_percent` and before loyalty programs:\n`round(cost_per_unit × quantity × (100 − discount_percent) / 100, 2)`.\nEcho the read's `manual_cost`, never its `cost`; `cost` already\nincludes loyalty discounts, and sending it applies them twice.\n"
          },
          "discount_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Discount in percent"
          }
        }
      },
      "record": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "external_id",
          "client_id",
          "staff_id",
          "date",
          "resource_instance_ids",
          "comment",
          "custom_color",
          "label_ids",
          "custom_field_values",
          "comer",
          "client_notification_settings",
          "is_instant_sms_notification_required",
          "attendance_service_items",
          "attendance_good_items",
          "clients_count"
        ],
        "anyOf": [
          {
            "required": [
              "length"
            ]
          },
          {
            "required": [
              "duration"
            ]
          }
        ],
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "attendance_status"
                ]
              },
              {
                "required": [
                  "attendance_status_slug"
                ]
              }
            ]
          }
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Appointment ID. `null` creates an Appointment."
          },
          "external_id": {
            "type": "string",
            "maxLength": 64,
            "description": "External Appointment ID. Echo the read's `external_id`."
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Booking User ID; `client_id` is the literal wire field. Must be `null`\nwhen the top-level `client` object is sent.\n"
          },
          "staff_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Team Member ID; `staff_id` is the literal wire field."
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
            "description": "Appointment start as Location wall-clock time without an offset.\nEcho the read's `date` exactly; do not derive it from `timestamp`.\n",
            "example": "2026-10-12T14:00:00"
          },
          "length": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400,
            "deprecated": true,
            "description": "Deprecated alias of `duration`"
          },
          "duration": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400,
            "description": "Appointment duration in seconds"
          },
          "technical_break_duration": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600,
            "description": "Technical break after the Appointment, in seconds. Echo\n`duration_details.technical_break_duration` from the read.\n"
          },
          "comment": {
            "type": "string",
            "maxLength": 36384,
            "description": "Appointment comment. Send an empty string when there is none."
          },
          "custom_color": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([0-9a-f]{6})?$",
            "description": "Appointment color without `#`; an empty string or `null` keeps the current color"
          },
          "attendance_status": {
            "type": "integer",
            "enum": [
              -1,
              0,
              1,
              2
            ],
            "description": "Attendance status: `-1` no-show, `0` waiting, `1` arrived, `2`\nconfirmed. Send this or `attendance_status_slug`.\n"
          },
          "attendance_status_slug": {
            "type": "string",
            "enum": [
              "absent",
              "waiting",
              "attended",
              "confirmed"
            ],
            "description": "Attendance status slug. Takes precedence over `attendance_status`."
          },
          "label_ids": {
            "type": "array",
            "description": "Tag IDs. The list replaces the Appointment's Tags.",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "resource_instance_ids": {
            "type": "array",
            "description": "Resource instance IDs. The list replaces the Appointment's resources.",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "custom_field_values": {
            "type": [
              "array",
              "null"
            ],
            "description": "Appointment Custom Field values. Echo the read's\n`custom_field_values` (`code`, `value`). `null` or `[]` leaves the\nstored values unchanged, but when the visit is or becomes arrived,\nthe Custom Fields that the Location requires on arrival must be\nsent. Values are saved only with the Custom Field edit right.\n",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code",
                "value"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Custom Field code"
                },
                "value": {
                  "oneOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  ],
                  "description": "Custom Field value"
                }
              }
            }
          },
          "comer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "title",
                  "slug",
                  "type"
                ],
                "properties": {
                  "id": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Walk-in visitor ID"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Walk-in visitor name"
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "Required by validation; not stored"
                  },
                  "type": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "enum": [
                      1,
                      2,
                      3,
                      null
                    ],
                    "description": "Visitor type; `1` person, `2` pet, `3` vehicle. `null` means person."
                  }
                }
              }
            ],
            "description": "Walk-in visitor of the Appointment. `null` removes the visitor."
          },
          "client_notification_settings": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "sms_hours_before_visit",
              "email_hours_before_visit"
            ],
            "properties": {
              "sms_hours_before_visit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 168,
                "description": "Hours before the Appointment to send the SMS reminder; `0` disables it"
              },
              "email_hours_before_visit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 168,
                "description": "Hours before the Appointment to send the email reminder; `0` disables it"
              }
            },
            "description": "Booking User reminder settings. Echo the read's `client_notification_settings`."
          },
          "is_instant_sms_notification_required": {
            "type": "boolean",
            "description": "Send the Booking User an immediate SMS about the Appointment. Send\n`false` when you only edit Services or Product Items.\n"
          },
          "attendance_service_items": {
            "type": "array",
            "description": "Service lines of the Appointment. The list replaces the Appointment's\nServices: a line without `id` is created and an existing line that is\nnot sent is deleted.\n",
            "items": {
              "$ref": "#/components/schemas/serviceItem"
            }
          },
          "attendance_good_items": {
            "type": "array",
            "description": "Product Item lines of the Appointment; `attendance_good_items` is the\nliteral wire field. The list replaces the Appointment's Product\nItems: a line with `id: null` is created and an existing line that is\nnot sent is deleted. `[]` deletes every Product Item of the\nAppointment.\n",
            "items": {
              "$ref": "#/components/schemas/productItem"
            }
          },
          "clients_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Number of places reserved by the Appointment"
          },
          "assistants": {
            "type": "array",
            "description": "Assistants per Service line. The list replaces the Appointment's\nassistants, and omitting the key removes them all.\nEcho every assistant from `attendance_service_items.assistants`.\n",
            "items": {
              "type": "object",
              "required": [
                "service_id",
                "assistant_id",
                "compensation_share_percent"
              ],
              "properties": {
                "service_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Service ID of the line the assistant works on"
                },
                "assistant_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Team Member ID of the assistant"
                },
                "compensation_share_percent": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Assistant's share of the Service compensation, in percent"
                }
              }
            }
          },
          "penalty_charge_decision": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "type",
                  "decision"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "no_show",
                      "late_reschedule",
                      "cancellation"
                    ]
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "apply",
                      "forgive"
                    ]
                  }
                }
              }
            ],
            "description": "Decision on a payment-policy penalty that this save triggers. Omit it\nunless you change the date or set a no-show. Requires the\nAppointment finances right.\n"
          }
        }
      },
      "client": {
        "type": "object",
        "additionalProperties": false,
        "description": "Booking User contacts. Send it only to create a Booking User or to attach\none found by these contacts; every record must then have `client_id:\nnull`. Omit it when you edit an existing Appointment.\n",
        "required": [
          "id",
          "name",
          "phone",
          "email",
          "surname",
          "patronymic",
          "gender",
          "birthday",
          "custom_field_values",
          "agreements"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Booking User ID, when known"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "First name"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Phone number in international format, digits only, or an empty string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Email address"
          },
          "surname": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "Last name"
          },
          "patronymic": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "Middle name"
          },
          "gender": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              0,
              1,
              2,
              null
            ],
            "description": "`0` not specified, `1` male, `2` female"
          },
          "birthday": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth (`YYYY-MM-DD`)"
          },
          "custom_field_values": {
            "type": [
              "array",
              "null"
            ],
            "description": "Booking User Custom Field values",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code",
                "value"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              }
            }
          },
          "agreements": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "is_newsletter_allowed",
                  "is_personal_data_processing_allowed"
                ],
                "properties": {
                  "is_newsletter_allowed": {
                    "type": "boolean"
                  },
                  "is_personal_data_processing_allowed": {
                    "type": "boolean"
                  }
                }
              }
            ],
            "description": "Consent flags, when the Location uses Booking User agreements"
          },
          "comment": {
            "type": "string",
            "minLength": 1,
            "description": "Booking User comment"
          },
          "national_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "National identification number"
          }
        }
      },
      "attendance_save_request": {
        "title": "Save Visit Appointments Request",
        "description": "Every key listed as required must be present, including keys whose value is\n`null` or an empty array. Records, Service lines, and Product Item lines reject\nunknown keys. Nested field names are literal wire names: `staff_id` is the\nTeam Member ID, `good_id` is the Product ID, `storage_id` is the Inventory\nID, and `client_id` is the Booking User ID.\n",
        "type": "object",
        "required": [
          "records"
        ],
        "properties": {
          "records": {
            "type": "array",
            "minItems": 1,
            "description": "Appointments to save. All records must belong to the same visit and the\nsame Booking User. Each record replaces the whole Appointment it\nidentifies.\n",
            "items": {
              "$ref": "#/components/schemas/record"
            }
          },
          "client": {
            "$ref": "#/components/schemas/client"
          },
          "ignore_conflicts": {
            "type": "boolean",
            "default": false,
            "description": "Skip the scheduling conflict checks (time slot, Team Member services,\nresources, deleted Team Member, prepaid Service removal, Booking User\ncontact changes). Permission checks still apply.\n"
          },
          "include": {
            "$ref": "#/components/schemas/attendance_include",
            "description": "Related resources to include in the response. The web app sends\n`include` in the request body.\n"
          }
        },
        "$defs": {
          "record": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "external_id",
              "client_id",
              "staff_id",
              "date",
              "resource_instance_ids",
              "comment",
              "custom_color",
              "label_ids",
              "custom_field_values",
              "comer",
              "client_notification_settings",
              "is_instant_sms_notification_required",
              "attendance_service_items",
              "attendance_good_items",
              "clients_count"
            ],
            "anyOf": [
              {
                "required": [
                  "length"
                ]
              },
              {
                "required": [
                  "duration"
                ]
              }
            ],
            "allOf": [
              {
                "anyOf": [
                  {
                    "required": [
                      "attendance_status"
                    ]
                  },
                  {
                    "required": [
                      "attendance_status_slug"
                    ]
                  }
                ]
              }
            ],
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Appointment ID. `null` creates an Appointment."
              },
              "external_id": {
                "type": "string",
                "maxLength": 64,
                "description": "External Appointment ID. Echo the read's `external_id`."
              },
              "client_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Booking User ID; `client_id` is the literal wire field. Must be `null`\nwhen the top-level `client` object is sent.\n"
              },
              "staff_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Team Member ID; `staff_id` is the literal wire field."
              },
              "date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Appointment start as Location wall-clock time without an offset.\nEcho the read's `date` exactly; do not derive it from `timestamp`.\n",
                "example": "2026-10-12T14:00:00"
              },
              "length": {
                "type": "integer",
                "minimum": 300,
                "maximum": 86400,
                "deprecated": true,
                "description": "Deprecated alias of `duration`"
              },
              "duration": {
                "type": "integer",
                "minimum": 300,
                "maximum": 86400,
                "description": "Appointment duration in seconds"
              },
              "technical_break_duration": {
                "type": "integer",
                "minimum": 0,
                "maximum": 3600,
                "description": "Technical break after the Appointment, in seconds. Echo\n`duration_details.technical_break_duration` from the read.\n"
              },
              "comment": {
                "type": "string",
                "maxLength": 36384,
                "description": "Appointment comment. Send an empty string when there is none."
              },
              "custom_color": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^([0-9a-f]{6})?$",
                "description": "Appointment color without `#`; an empty string or `null` keeps the current color"
              },
              "attendance_status": {
                "type": "integer",
                "enum": [
                  -1,
                  0,
                  1,
                  2
                ],
                "description": "Attendance status: `-1` no-show, `0` waiting, `1` arrived, `2`\nconfirmed. Send this or `attendance_status_slug`.\n"
              },
              "attendance_status_slug": {
                "type": "string",
                "enum": [
                  "absent",
                  "waiting",
                  "attended",
                  "confirmed"
                ],
                "description": "Attendance status slug. Takes precedence over `attendance_status`."
              },
              "label_ids": {
                "type": "array",
                "description": "Tag IDs. The list replaces the Appointment's Tags.",
                "items": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "resource_instance_ids": {
                "type": "array",
                "description": "Resource instance IDs. The list replaces the Appointment's resources.",
                "items": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "custom_field_values": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "Appointment Custom Field values. Echo the read's\n`custom_field_values` (`code`, `value`). `null` or `[]` leaves the\nstored values unchanged, but when the visit is or becomes arrived,\nthe Custom Fields that the Location requires on arrival must be\nsent. Values are saved only with the Custom Field edit right.\n",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "value"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Custom Field code"
                    },
                    "value": {
                      "oneOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      ],
                      "description": "Custom Field value"
                    }
                  }
                }
              },
              "comer": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "title",
                      "slug",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "description": "Walk-in visitor ID"
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 64,
                        "description": "Walk-in visitor name"
                      },
                      "slug": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64,
                        "description": "Required by validation; not stored"
                      },
                      "type": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "enum": [
                          1,
                          2,
                          3,
                          null
                        ],
                        "description": "Visitor type; `1` person, `2` pet, `3` vehicle. `null` means person."
                      }
                    }
                  }
                ],
                "description": "Walk-in visitor of the Appointment. `null` removes the visitor."
              },
              "client_notification_settings": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sms_hours_before_visit",
                  "email_hours_before_visit"
                ],
                "properties": {
                  "sms_hours_before_visit": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 168,
                    "description": "Hours before the Appointment to send the SMS reminder; `0` disables it"
                  },
                  "email_hours_before_visit": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 168,
                    "description": "Hours before the Appointment to send the email reminder; `0` disables it"
                  }
                },
                "description": "Booking User reminder settings. Echo the read's `client_notification_settings`."
              },
              "is_instant_sms_notification_required": {
                "type": "boolean",
                "description": "Send the Booking User an immediate SMS about the Appointment. Send\n`false` when you only edit Services or Product Items.\n"
              },
              "attendance_service_items": {
                "type": "array",
                "description": "Service lines of the Appointment. The list replaces the Appointment's\nServices: a line without `id` is created and an existing line that is\nnot sent is deleted.\n",
                "items": {
                  "$ref": "#/components/schemas/serviceItem"
                }
              },
              "attendance_good_items": {
                "type": "array",
                "description": "Product Item lines of the Appointment; `attendance_good_items` is the\nliteral wire field. The list replaces the Appointment's Product\nItems: a line with `id: null` is created and an existing line that is\nnot sent is deleted. `[]` deletes every Product Item of the\nAppointment.\n",
                "items": {
                  "$ref": "#/components/schemas/productItem"
                }
              },
              "clients_count": {
                "type": "integer",
                "minimum": 1,
                "description": "Number of places reserved by the Appointment"
              },
              "assistants": {
                "type": "array",
                "description": "Assistants per Service line. The list replaces the Appointment's\nassistants, and omitting the key removes them all.\nEcho every assistant from `attendance_service_items.assistants`.\n",
                "items": {
                  "type": "object",
                  "required": [
                    "service_id",
                    "assistant_id",
                    "compensation_share_percent"
                  ],
                  "properties": {
                    "service_id": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Service ID of the line the assistant works on"
                    },
                    "assistant_id": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Team Member ID of the assistant"
                    },
                    "compensation_share_percent": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Assistant's share of the Service compensation, in percent"
                    }
                  }
                }
              },
              "penalty_charge_decision": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "decision"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "no_show",
                          "late_reschedule",
                          "cancellation"
                        ]
                      },
                      "decision": {
                        "type": "string",
                        "enum": [
                          "apply",
                          "forgive"
                        ]
                      }
                    }
                  }
                ],
                "description": "Decision on a payment-policy penalty that this save triggers. Omit it\nunless you change the date or set a no-show. Requires the\nAppointment finances right.\n"
              }
            }
          },
          "serviceItem": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "service_id",
              "quantity",
              "cost_per_unit",
              "manual_cost",
              "discount_percent"
            ],
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Appointment Service line ID; `null` creates a line"
              },
              "service_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Service ID"
              },
              "quantity": {
                "type": "integer",
                "minimum": 1,
                "maximum": 15000,
                "description": "Number of Service units"
              },
              "cost_per_unit": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Unit price before discount"
              },
              "manual_cost": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Line total after `discount_percent`. It must match\n`cost_per_unit × quantity × (100 − discount_percent) / 100`;\notherwise the request returns `400`.\n"
              },
              "discount_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "Discount in percent"
              },
              "composite_service_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Composite Service ID when the line belongs to a composite Service.\nRead it from\n`attendance_service_items.attendance_service_composite.composite_service`.\n"
              }
            }
          },
          "productItem": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "good_id",
              "unit_id",
              "storage_id",
              "staff_id",
              "operation_unit_type",
              "number",
              "planned_activation_date",
              "marks",
              "quantity",
              "cost_per_unit",
              "manual_cost",
              "discount_percent"
            ],
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Appointment Product Item ID. `null` creates a line. An ID that does\nnot belong to this Appointment returns `422`.\n"
              },
              "good_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Product ID; `good_id` is the literal wire field."
              },
              "unit_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Unit ID. Echo the read's `unit_id`; for a new line send the Product's\nsale unit. The stored unit always comes from the Product.\n"
              },
              "storage_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Inventory ID to write the Product off from; `storage_id` is the literal wire field."
              },
              "staff_id": {
                "type": "integer",
                "minimum": 1,
                "description": "Team Member ID credited with the sale; `staff_id` is the literal wire\nfield. The web app uses the Appointment's Team Member.\n"
              },
              "operation_unit_type": {
                "type": "string",
                "enum": [
                  "sale",
                  "consumable"
                ],
                "description": "`sale` sells the Product to the Booking User; `consumable` writes it\noff as a Service consumable. Echo the read's `operation_type_slug`.\n"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 32,
                "description": "Gift card or membership number. Required for a gift card unless its\ntype allows an empty code, and for an existing gift card or\nmembership line, where it must equal the read's\n`loyalty_certificate.number` or `loyalty_abonement.number`. `null`\nfor plain Products.\n"
              },
              "planned_activation_date": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "Planned membership activation date (`YYYY-MM-DD`). Required when the\nmembership type expires on a specific date. Echo the read's\n`loyalty_abonement.planned_activation_date`; `null` for other lines.\n"
              },
              "marks": {
                "type": "array",
                "description": "Goods marking codes for the line. Echo the read's `marks`; send `[]`\nwhen the Product is not marked.\n",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "quantity": {
                "type": "number",
                "minimum": 0.001,
                "maximum": 1000000000,
                "description": "Quantity in sale units, as a positive number. Echo the read's\n`quantity`.\n"
              },
              "cost_per_unit": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Unit price before discount. For a new line, the Product's sale price."
              },
              "manual_cost": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Line total after `discount_percent` and before loyalty programs:\n`round(cost_per_unit × quantity × (100 − discount_percent) / 100, 2)`.\nEcho the read's `manual_cost`, never its `cost`; `cost` already\nincludes loyalty discounts, and sending it applies them twice.\n"
              },
              "discount_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "Discount in percent"
              }
            }
          },
          "client": {
            "type": "object",
            "additionalProperties": false,
            "description": "Booking User contacts. Send it only to create a Booking User or to attach\none found by these contacts; every record must then have `client_id:\nnull`. Omit it when you edit an existing Appointment.\n",
            "required": [
              "id",
              "name",
              "phone",
              "email",
              "surname",
              "patronymic",
              "gender",
              "birthday",
              "custom_field_values",
              "agreements"
            ],
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Booking User ID, when known"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "description": "First name"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Phone number in international format, digits only, or an empty string"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "email",
                "description": "Email address"
              },
              "surname": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "Last name"
              },
              "patronymic": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "Middle name"
              },
              "gender": {
                "type": [
                  "integer",
                  "null"
                ],
                "enum": [
                  0,
                  1,
                  2,
                  null
                ],
                "description": "`0` not specified, `1` male, `2` female"
              },
              "birthday": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "Date of birth (`YYYY-MM-DD`)"
              },
              "custom_field_values": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "Booking User Custom Field values",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "value"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    }
                  }
                }
              },
              "agreements": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "is_newsletter_allowed",
                      "is_personal_data_processing_allowed"
                    ],
                    "properties": {
                      "is_newsletter_allowed": {
                        "type": "boolean"
                      },
                      "is_personal_data_processing_allowed": {
                        "type": "boolean"
                      }
                    }
                  }
                ],
                "description": "Consent flags, when the Location uses Booking User agreements"
              },
              "comment": {
                "type": "string",
                "minLength": 1,
                "description": "Booking User comment"
              },
              "national_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "National identification number"
              }
            }
          }
        }
      },
      "include": {
        "title": "Appointment Includes",
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "string",
          "enum": [
            "client",
            "client.custom_field_values",
            "staff",
            "services",
            "goods",
            "resource_instances",
            "labels",
            "attendance_service_items",
            "attendance_good_items",
            "attendance_document",
            "transactions",
            "fast_payment_settings",
            "acceptance_free",
            "custom_field_values",
            "comer",
            "client_notification_settings",
            "client_schedule",
            "duration_details"
          ]
        }
      },
      "resource_occupation_resource": {
        "title": "Resource Occupation Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "resource_occupation",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Resource occupation ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "source_type",
              "source_type_slug",
              "source_id",
              "resource_id",
              "resource_instance_id",
              "from",
              "to"
            ],
            "properties": {
              "source_type": {
                "type": "string",
                "enum": [
                  "record",
                  "activity"
                ],
                "deprecated": true,
                "description": "Deprecated source type; use `source_type_slug`"
              },
              "source_type_slug": {
                "type": "string",
                "enum": [
                  "record",
                  "activity"
                ],
                "description": "Occupation source. Literal `record` and `activity` wire values mean\nAppointment and Event respectively.\n"
              },
              "source_id": {
                "type": "integer",
                "description": "Appointment or Event ID, depending on `source_type_slug`"
              },
              "resource_id": {
                "type": "integer",
                "description": "Resource ID"
              },
              "resource_instance_id": {
                "type": "integer",
                "description": "Resource instance ID"
              },
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                "description": "Occupation start in the Location timezone"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
                "description": "Occupation end in the Location timezone"
              }
            }
          }
        }
      },
      "event_include": {
        "title": "Event Includes",
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "string",
          "enum": [
            "staff",
            "service",
            "resource_instances",
            "labels",
            "duration_details",
            "master"
          ]
        }
      },
      "event_resource": {
        "title": "Event Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "activity",
            "description": "Literal JSON:API resource type returned for Events"
          },
          "id": {
            "type": "string",
            "description": "Event ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "master_id",
              "staff_id",
              "service_id",
              "timestamp",
              "length",
              "capacity",
              "clients_count",
              "color",
              "instructions",
              "stream_link",
              "font_color",
              "notified",
              "comment",
              "deleted",
              "schedule_id",
              "schedule_till",
              "schedule_event_modified",
              "date"
            ],
            "properties": {
              "master_id": {
                "type": "integer",
                "deprecated": true,
                "description": "Deprecated wire field for Team Member ID; use `staff_id`"
              },
              "staff_id": {
                "type": "integer",
                "description": "Team Member ID"
              },
              "service_id": {
                "type": "integer",
                "description": "Service ID"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64",
                "description": "Event start as a Unix timestamp"
              },
              "length": {
                "type": "integer",
                "minimum": 1,
                "maximum": 86400,
                "description": "Event duration in seconds"
              },
              "capacity": {
                "type": "integer",
                "minimum": 1,
                "description": "Total number of available places"
              },
              "clients_count": {
                "type": "integer",
                "minimum": 0,
                "description": "Number of Booking Users currently booked"
              },
              "color": {
                "type": "string",
                "description": "Event background color including `#`"
              },
              "instructions": {
                "type": "string",
                "description": "Instructions for Booking Users"
              },
              "stream_link": {
                "type": "string",
                "description": "Online Event stream link, or an empty string"
              },
              "font_color": {
                "type": "string",
                "description": "Event text color including `#`"
              },
              "notified": {
                "type": "boolean",
                "description": "Whether an Event notification was sent"
              },
              "comment": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Event comment"
              },
              "deleted": {
                "type": "boolean",
                "description": "Whether the Event is deleted (a deleted Event stays readable by ID)"
              },
              "schedule_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Event Schedule ID"
              },
              "schedule_till": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "date",
                      "timezone_type",
                      "timezone"
                    ],
                    "properties": {
                      "date": {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}$"
                      },
                      "timezone_type": {
                        "type": "integer"
                      },
                      "timezone": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Event Schedule end represented by the production DateTime wire object"
              },
              "schedule_event_modified": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Whether this scheduled Event differs from its Event Schedule"
              },
              "date": {
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[+-][0-9]{4}$",
                "description": "Event start in the Location timezone with a numeric offset"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "staff": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Team Member relationship. `staff` is the literal wire relationship name."
              },
              "master": {
                "$ref": "#/components/schemas/toOneRelationship",
                "description": "Legacy Team Member relationship. `master` is the literal wire relationship name."
              },
              "service": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "resource_instances": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "labels": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "duration_details": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        }
      },
      "event_collection_response": {
        "title": "Event Collection Response",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/event_resource"
            }
          },
          "included": {
            "type": "array",
            "description": "Resources requested through `include`, when available",
            "items": {
              "$ref": "#/components/schemas/includedResource"
            }
          }
        }
      },
      "event_create_request": {
        "title": "Create Event Request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "team_member_id",
          "service_id",
          "resource_instance_ids",
          "label_ids",
          "date",
          "length",
          "capacity"
        ],
        "properties": {
          "team_member_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Team Member ID"
          },
          "service_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Service ID"
          },
          "resource_instance_ids": {
            "type": "array",
            "description": "Resource Instance IDs; an empty array is allowed",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "label_ids": {
            "type": "array",
            "description": "Tag IDs; an empty array is allowed",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "date": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
            "description": "Event start in the Location timezone as `YYYY-MM-DD HH:MM:SS`"
          },
          "length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "multipleOf": 300,
            "description": "Total Event duration in seconds, including any technical break"
          },
          "technical_break_duration": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 3600,
            "multipleOf": 300,
            "description": "Technical break in seconds; `null` uses the Location setting"
          },
          "capacity": {
            "type": "integer",
            "minimum": 1,
            "description": "Total number of available places"
          },
          "comment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Event comment"
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-f]{6}$",
            "description": "Event color including `#`"
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Instructions for Booking Users"
          },
          "stream_link": {
            "type": "string",
            "minLength": 1,
            "description": "Online Event stream link"
          },
          "force": {
            "type": "boolean",
            "default": false,
            "description": "Skip Team Member and Resource Instance availability conflicts"
          }
        }
      },
      "event_item_response": {
        "title": "Event Item Response",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/event_resource"
          },
          "included": {
            "type": "array",
            "description": "Resources requested through `include`, when available",
            "items": {
              "$ref": "#/components/schemas/includedResource"
            }
          },
          "meta": {
            "type": "array",
            "maxItems": 0,
            "description": "Empty JSON array returned for an Event item"
          }
        }
      },
      "response_success_false_object": {
        "title": "Unsuccessful response status",
        "type": "boolean",
        "description": "Response status.",
        "example": false
      },
      "response_data_null_object": {
        "title": "No data in response",
        "type": [
          "object",
          "null"
        ],
        "description": "Response data.",
        "example": null
      },
      "response_meta_error_unauthorized_object": {
        "title": "Response error message",
        "type": "object",
        "description": "Additional response data.",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message.",
            "example": "Authentication needed."
          }
        }
      },
      "401_unauthorized_response": {
        "type": "object",
        "properties": {
          "success": {
            "$ref": "#/components/schemas/response_success_false_object"
          },
          "data": {
            "$ref": "#/components/schemas/response_data_null_object"
          },
          "meta": {
            "$ref": "#/components/schemas/response_meta_error_unauthorized_object"
          }
        }
      },
      "response_meta_error_forbidden_object": {
        "title": "Response error message",
        "type": "object",
        "description": "Additional response data.",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message.",
            "example": "Access denied."
          }
        }
      },
      "403_forbidden_response": {
        "type": "object",
        "properties": {
          "success": {
            "$ref": "#/components/schemas/response_success_false_object"
          },
          "data": {
            "$ref": "#/components/schemas/response_data_null_object"
          },
          "meta": {
            "$ref": "#/components/schemas/response_meta_error_forbidden_object"
          }
        }
      },
      "response_meta_empty_object": {
        "title": "Empty meta object",
        "type": [
          "object",
          "array"
        ],
        "description": "Additional response data (empty object or empty array)",
        "example": {}
      },
      "404_not_found_response": {
        "type": "object",
        "properties": {
          "success": {
            "$ref": "#/components/schemas/response_success_false_object"
          },
          "data": {
            "$ref": "#/components/schemas/response_data_null_object"
          },
          "meta": {
            "$ref": "#/components/schemas/response_meta_empty_object"
          }
        }
      },
      "event_update_request": {
        "title": "Update Event Request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "team_member_id",
          "service_id",
          "resource_instance_ids",
          "label_ids",
          "date",
          "length",
          "capacity"
        ],
        "properties": {
          "team_member_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Team Member ID"
          },
          "service_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Service ID"
          },
          "resource_instance_ids": {
            "type": "array",
            "description": "Resource Instance IDs; an empty array is allowed",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "label_ids": {
            "type": "array",
            "description": "Tag IDs; an empty array is allowed",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "date": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
            "description": "Event start in the Location timezone as `YYYY-MM-DD HH:MM:SS`"
          },
          "length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "multipleOf": 300,
            "description": "Total Event duration in seconds, including any technical break"
          },
          "technical_break_duration": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 3600,
            "multipleOf": 300,
            "description": "Technical break in seconds; `null` keeps or derives the current value"
          },
          "capacity": {
            "type": "integer",
            "minimum": 1,
            "description": "Total number of available places"
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 255,
            "description": "Event comment"
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^#[0-9a-f]{6}$",
            "description": "Event color including `#`"
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 500,
            "description": "Instructions for Booking Users"
          },
          "stream_link": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "Online Event stream link"
          },
          "force": {
            "type": "boolean",
            "default": false,
            "description": "Skip Team Member and Resource Instance availability conflicts"
          }
        }
      },
      "event_appointment_create_request": {
        "title": "Create Event Appointment Request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client",
          "clients_count"
        ],
        "properties": {
          "client_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Deprecated wire field for an existing Booking User ID; use `client.id`"
          },
          "comer_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Walk-in visitor ID"
          },
          "client": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "phone",
              "email",
              "surname",
              "patronymic",
              "gender",
              "birthday",
              "custom_field_values",
              "agreements"
            ],
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Existing Booking User ID, or `null` for a new Booking User"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "description": "Booking User first name"
              },
              "phone": {
                "oneOf": [
                  {
                    "type": "string",
                    "const": ""
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9]{9,15}$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Booking User phone number as 9 to 15 digits; an empty string is also accepted"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "email",
                "description": "Booking User email address"
              },
              "surname": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "Booking User last name"
              },
              "patronymic": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "Literal wire field for a Booking User middle name"
              },
              "gender": {
                "type": [
                  "integer",
                  "null"
                ],
                "enum": [
                  0,
                  1,
                  2,
                  null
                ],
                "description": "Booking User gender wire value"
              },
              "birthday": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "Booking User birth date"
              },
              "custom_field_values": {
                "oneOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "value"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Booking User custom fields"
              },
              "agreements": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "is_newsletter_allowed",
                      "is_personal_data_processing_allowed"
                    ],
                    "properties": {
                      "is_newsletter_allowed": {
                        "type": "boolean"
                      },
                      "is_personal_data_processing_allowed": {
                        "type": "boolean"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Booking User consent flags"
              },
              "comment": {
                "type": "string",
                "minLength": 1,
                "description": "Booking User comment"
              },
              "national_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "description": "Booking User national identifier - the client IIN for locations in Kazakhstan, where it must be 12 digits with a valid check digit. Accepted only for locations in Kazakhstan and ignored for other countries. When omitted or null, the IIN already saved for the client is left unchanged."
              }
            }
          },
          "comer": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "Walk-in visitor name"
              }
            }
          },
          "clients_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Number of places reserved by the Appointment"
          },
          "is_trial_service": {
            "type": "boolean",
            "description": "Whether this is a trial Service Appointment"
          }
        }
      },
      "event_appointment_item_response": {
        "title": "Event Appointment Item Response",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/appointment_resource"
          },
          "included": {
            "type": "array",
            "description": "Resources requested through `include`, when available",
            "items": {
              "$ref": "#/components/schemas/includedResource"
            }
          },
          "meta": {
            "type": "array",
            "maxItems": 0,
            "description": "Empty JSON array returned for an Event Appointment item"
          }
        }
      },
      "event_appointment_update_request": {
        "title": "Update Event Appointment Request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attendance_service_item"
        ],
        "properties": {
          "attendance_service_item": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "cost_per_unit",
              "discount_percent",
              "manual_cost"
            ],
            "properties": {
              "cost_per_unit": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              },
              "discount_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "manual_cost": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              },
              "is_trial": {
                "type": "boolean",
                "description": "Whether this is a trial Service Appointment"
              }
            }
          },
          "attendance_good_items": {
            "type": "array",
            "description": "Literal wire field for Appointment Product Items",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "good_id",
                "unit_id",
                "storage_id",
                "staff_id",
                "operation_unit_type",
                "number",
                "quantity",
                "cost_per_unit",
                "manual_cost",
                "discount_percent",
                "marks",
                "planned_activation_date"
              ],
              "properties": {
                "id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1,
                  "description": "Appointment Product Item ID; `null` creates an item"
                },
                "good_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Literal wire field for Product ID"
                },
                "unit_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Unit ID"
                },
                "storage_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Inventory Location ID"
                },
                "staff_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Team Member ID"
                },
                "operation_unit_type": {
                  "type": "string",
                  "enum": [
                    "sale",
                    "consumable"
                  ],
                  "description": "Product operation type"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 32
                },
                "quantity": {
                  "type": "number",
                  "minimum": 0.001,
                  "maximum": 1000000000
                },
                "cost_per_unit": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000000000
                },
                "manual_cost": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000000000
                },
                "discount_percent": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                },
                "marks": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "planned_activation_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                }
              }
            }
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "Appointment comment"
          },
          "label_ids": {
            "type": [
              "array",
              "null"
            ],
            "description": "Tag IDs",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{6}$",
            "description": "Appointment color without `#`"
          },
          "clients_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Number of places reserved by the Appointment"
          }
        }
      },
      "event_appointment_reschedule_request": {
        "title": "Reschedule Event Appointment Request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reschedule_activity_id"
        ],
        "properties": {
          "reschedule_activity_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Literal wire field for the destination Event ID"
          },
          "with_comer": {
            "type": "boolean",
            "description": "Whether to retain the linked walk-in visitor"
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "Appointment comment"
          },
          "clients_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Number of places reserved by the Appointment"
          }
        }
      },
      "booking_user_include": {
        "title": "Booking User Includes",
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "string",
          "enum": [
            "labels",
            "first_successful_visit",
            "loyalty_cards",
            "loyalty_certificates",
            "loyalty_abonements",
            "custom_field_values",
            "agreements"
          ]
        }
      },
      "booking_user_resource": {
        "title": "Booking User Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "client",
            "description": "Literal legacy JSON:API resource type for a Booking User"
          },
          "id": {
            "type": "string",
            "description": "Booking User profile ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "surname",
              "patronymic",
              "phone",
              "additional_phone",
              "email",
              "comment",
              "client_tips",
              "birthday",
              "card_number",
              "gender",
              "discount",
              "discount_percent",
              "national_id"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Booking User first name"
              },
              "surname": {
                "type": "string",
                "description": "Booking User surname, subject to Business User permissions"
              },
              "patronymic": {
                "type": "string",
                "description": "Booking User patronymic, subject to Business User permissions"
              },
              "phone": {
                "type": "string",
                "description": "Booking User phone number, subject to Business User permissions"
              },
              "additional_phone": {
                "type": "string",
                "description": "Additional phone number, or an empty string"
              },
              "email": {
                "type": "string",
                "description": "Email address, or an empty string"
              },
              "comment": {
                "type": "string",
                "description": "Booking User card comment, subject to Business User permissions"
              },
              "client_tips": {
                "type": "boolean",
                "description": "Whether the Booking User can leave tips"
              },
              "birthday": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "description": "Birthday without a timezone, or `null`"
              },
              "card_number": {
                "type": "string",
                "description": "Booking User card number, or an empty string"
              },
              "gender": {
                "type": "integer",
                "description": "Literal gender wire value"
              },
              "discount": {
                "type": "number",
                "description": "Deprecated discount percentage; use `discount_percent`"
              },
              "discount_percent": {
                "type": "number",
                "description": "Booking User discount percentage"
              },
              "national_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "National ID of the Booking User (CPF for Brazil, IIN for Kazakhstan), subject to Business User permissions; `null` when not set or hidden"
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "labels": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "first_successful_visit": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "loyalty_cards": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "loyalty_certificates": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "loyalty_abonements": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "custom_field_values": {
                "$ref": "#/components/schemas/toManyRelationship"
              },
              "agreements": {
                "$ref": "#/components/schemas/toOneRelationship"
              }
            }
          }
        }
      },
      "statistics_attributes": {
        "title": "Booking User Attendance Statistics Attributes",
        "type": "object",
        "required": [
          "successful_attendances_count",
          "failed_attendances_count",
          "balance_amount",
          "spent_amount",
          "paid_amount",
          "last_successful_attendance_datetime"
        ],
        "properties": {
          "company_id": {
            "type": "integer",
            "description": "Location ID; present only in Location statistics"
          },
          "successful_attendances_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of successful attendances"
          },
          "failed_attendances_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of failed attendances"
          },
          "balance_amount": {
            "type": "number",
            "description": "Current balance"
          },
          "spent_amount": {
            "type": "number",
            "description": "Total spent amount"
          },
          "paid_amount": {
            "type": "number",
            "description": "Total paid amount"
          },
          "last_successful_attendance_datetime": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
            "description": "Last successful attendance in the Location timezone"
          }
        }
      },
      "statistics_relationships": {
        "title": "Booking User Attendance Statistics Relationships",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deposits"
        ],
        "properties": {
          "deposits": {
            "$ref": "#/components/schemas/toManyRelationship"
          }
        }
      },
      "location_attendance_statistics_resource": {
        "title": "Booking User Location Attendance Statistics Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes",
          "relationships"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "client_attendances_statistic",
            "description": "Literal legacy JSON:API resource type for Location statistics"
          },
          "id": {
            "type": "string",
            "description": "Compound Booking User and Location identifier"
          },
          "attributes": {
            "allOf": [
              {
                "$ref": "#/components/schemas/statistics_attributes"
              },
              {
                "type": "object",
                "required": [
                  "company_id"
                ]
              }
            ]
          },
          "relationships": {
            "$ref": "#/components/schemas/statistics_relationships"
          }
        }
      },
      "deposit_resource": {
        "title": "Booking User Client Account Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "timetable_deposit"
          },
          "id": {
            "type": "string",
            "description": "Client Account ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "balance",
              "reserved_balance",
              "available_balance"
            ],
            "properties": {
              "title": {
                "type": "string",
                "description": "Client Account name"
              },
              "balance": {
                "type": "number",
                "description": "Total balance"
              },
              "reserved_balance": {
                "type": "number",
                "description": "Reserved balance"
              },
              "available_balance": {
                "type": "number",
                "description": "Available balance after reservations"
              }
            }
          }
        }
      },
      "chain_attendance_statistics_resource": {
        "title": "Booking User Chain Attendance Statistics Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes",
          "relationships"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "client_chain_attendances_statistic",
            "description": "Literal legacy JSON:API resource type for Chain statistics"
          },
          "id": {
            "type": "string",
            "description": "Compound Booking User and Chain identifier"
          },
          "attributes": {
            "allOf": [
              {
                "$ref": "#/components/schemas/statistics_attributes"
              },
              {
                "type": "object",
                "required": [
                  "chain_id"
                ],
                "properties": {
                  "chain_id": {
                    "type": "integer",
                    "description": "Chain ID"
                  }
                }
              }
            ]
          },
          "relationships": {
            "$ref": "#/components/schemas/statistics_relationships"
          }
        }
      },
      "custom_field_resource": {
        "title": "Custom Field Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "custom_field",
            "description": "Literal JSON:API resource type"
          },
          "id": {
            "type": "string",
            "description": "Location Custom Field ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "slug",
              "parent_entity_type",
              "entity_slug",
              "relation_entity_type",
              "show_in_ui",
              "is_visible",
              "title",
              "user_can_edit",
              "is_editable",
              "is_required",
              "weight",
              "values"
            ],
            "properties": {
              "code": {
                "type": "string",
                "deprecated": true,
                "description": "Deprecated Custom Field key; use `slug`"
              },
              "slug": {
                "type": "string",
                "description": "Custom Field key used in API payloads"
              },
              "parent_entity_type": {
                "type": "string",
                "enum": [
                  "record",
                  "client"
                ],
                "deprecated": true,
                "description": "Deprecated entity wire value; use `entity_slug`"
              },
              "entity_slug": {
                "type": "string",
                "enum": [
                  "record",
                  "client"
                ],
                "description": "Entity wire value. `record` means Appointment and `client` means\nBooking User.\n"
              },
              "relation_entity_type": {
                "type": "null",
                "description": "Reserved wire field; currently always `null`"
              },
              "show_in_ui": {
                "type": "boolean",
                "deprecated": true,
                "description": "Deprecated visibility flag; use `is_visible`"
              },
              "is_visible": {
                "type": "boolean",
                "description": "Whether the Custom Field is visible in Altegio interfaces"
              },
              "title": {
                "type": "string",
                "description": "Custom Field name"
              },
              "user_can_edit": {
                "type": "boolean",
                "deprecated": true,
                "description": "Deprecated editability flag; use `is_editable`"
              },
              "is_editable": {
                "type": "boolean",
                "description": "Whether Business Users can edit the Custom Field value"
              },
              "is_required": {
                "type": "boolean",
                "description": "Whether a value is required"
              },
              "weight": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Display order; `null` when no order is set"
              },
              "values": {
                "type": "array",
                "description": "Configured values for list-like Custom Fields",
                "items": {}
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "description": "Present when related data is requested through `include`",
            "properties": {
              "custom_field_type": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "type": {
                "$ref": "#/components/schemas/toOneRelationship"
              },
              "ui_options": {
                "$ref": "#/components/schemas/toManyRelationship"
              }
            }
          }
        }
      },
      "custom_field_type_resource": {
        "title": "Custom Field Type Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "custom_field_type"
          },
          "id": {
            "type": "string",
            "description": "Custom Field Type ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "slug",
              "title"
            ],
            "properties": {
              "code": {
                "type": "string",
                "deprecated": true,
                "description": "Deprecated type key; use `slug`"
              },
              "slug": {
                "type": "string",
                "description": "Custom Field Type key"
              },
              "title": {
                "type": "string",
                "description": "Custom Field Type name"
              }
            }
          }
        }
      },
      "custom_field_ui_option_resource": {
        "title": "Custom Field UI Option Resource",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "custom_field_ui_option"
          },
          "id": {
            "type": "string",
            "description": "Custom Field UI Option ID"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "slug",
              "value"
            ],
            "properties": {
              "slug": {
                "type": "string",
                "description": "UI Option key"
              },
              "value": {
                "type": "boolean",
                "description": "Whether the UI Option is enabled"
              }
            }
          }
        }
      },
      "tag_attributes": {
        "type": "object",
        "description": "Tag attributes (v2 API JSON:API format)",
        "additionalProperties": false,
        "properties": {
          "company_id": {
            "type": "integer",
            "description": "Location ID",
            "example": 68570
          },
          "title": {
            "type": "string",
            "description": "Tag name",
            "example": "VIP Booking User"
          },
          "color": {
            "type": "string",
            "description": "Tag background color in",
            "example": "#ff2828"
          },
          "font_color": {
            "type": "string",
            "description": "Tag font color in",
            "example": "#ffffff"
          },
          "icon": {
            "type": "string",
            "description": "Icon name",
            "example": "star"
          },
          "entity_type": {
            "type": "string",
            "description": "Literal entity alias. `client` identifies Booking Users and `record`\nidentifies Appointments.\n",
            "enum": [
              "common",
              "client",
              "record",
              "activity"
            ],
            "example": "client"
          },
          "is_deleted": {
            "type": "boolean",
            "description": "Whether the Tag is deleted",
            "example": false
          },
          "is_editable": {
            "type": "boolean",
            "description": "Whether the Tag can be updated or deleted",
            "example": true
          },
          "salon_id": {
            "type": "integer",
            "description": "Deprecated wire field for Location ID; use `company_id`",
            "deprecated": true,
            "example": 68570
          },
          "entity": {
            "type": "integer",
            "description": "Deprecated numeric entity type: 0 general, 1 Booking User, 2 Appointment, 3 Event",
            "deprecated": true,
            "example": 1
          },
          "entity_slug": {
            "type": "string",
            "description": "Deprecated literal entity alias; use `entity_type`",
            "deprecated": true,
            "example": "client"
          },
          "deleted": {
            "type": "integer",
            "description": "Deprecated deletion wire value; use `is_deleted`",
            "deprecated": true,
            "example": 0
          },
          "not_editable": {
            "type": "integer",
            "description": "Deprecated editability wire value; use `is_editable`",
            "deprecated": true,
            "example": 0
          }
        },
        "required": [
          "company_id",
          "title",
          "color",
          "entity_type",
          "is_deleted",
          "is_editable"
        ]
      }
    },
    "responses": {
      "401_unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/401_unauthorized_response"
            }
          }
        }
      },
      "403_forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/403_forbidden_response"
            }
          }
        }
      },
      "404_not_found": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/404_not_found_response"
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "POS & Scheduling",
      "tags": [
        "Services",
        "Products",
        "Team Members",
        "Appointments",
        "Events",
        "Booking Users"
      ]
    },
    {
      "name": "Administrative",
      "tags": [
        "Custom Fields",
        "Tags"
      ]
    }
  ],
  "tags": [
    {
      "name": "Services",
      "description": "Service catalog management.\n\nRetrieve services and service categories for a location.\n"
    },
    {
      "name": "Products",
      "description": "Product inventory management.\n\nRetrieve Products, Product Categories, measurement Units, stock levels,\nand Appointment Product Items.\n"
    },
    {
      "name": "Team Members",
      "description": "Team Member and position management.\n\nManage Team Member positions and retrieve Team Member information.\n"
    },
    {
      "name": "Appointments",
      "description": "Appointment management.\n\nList and manage appointments for a location.\n"
    },
    {
      "name": "Events",
      "description": "Group Event management."
    },
    {
      "name": "Booking Users",
      "description": "Booking User attendance and financial statistics.\n"
    },
    {
      "name": "Custom Fields",
      "description": "Location-specific Custom Fields for Appointments and Booking Users.\n"
    },
    {
      "name": "Tags",
      "description": "Booking User tagging system."
    }
  ],
  "paths": {
    "/locations/{location_id}/services": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Services",
        "description": "Retrieve Services for a Location, optionally filtered by Service IDs.\n\nThe response uses JSON:API resource objects. Pagination uses `page` and\n`limit`; pagination metadata is not returned.\n\nRelated data can be requested by repeating the `include` parameter, for\nexample `?include=resources&include=company_links`.\n",
        "operationId": "list_services",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[service_ids][]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Filter by Service IDs"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Services to return"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "resources",
                  "service_composite",
                  "resource_links",
                  "company_links",
                  "trial_settings"
                ]
              }
            },
            "description": "Related resources to include. The wire values are literal API keys:\n`company_links` contains Location-specific Service links.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Services retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/service_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "service",
                      "id": "100",
                      "attributes": {
                        "title": "Haircut",
                        "category_id": 5
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Services for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/services/{service_id}": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Service",
        "description": "Retrieve a Service for a Location as a JSON:API resource object.\n\nRelated data can be requested by repeating the `include` parameter, for\nexample `?include=resources&include=company_links`.\n",
        "operationId": "get_service",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "service_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Service ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "resources",
                  "service_composite",
                  "resource_links",
                  "company_links",
                  "trial_settings"
                ]
              }
            },
            "description": "Related resources to include. The wire values are literal API keys:\n`company_links` contains Location-specific Service links.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Service retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/service_resource"
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "service",
                    "id": "100",
                    "attributes": {
                      "title": "Haircut",
                      "category_id": 5
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read this Service",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Service or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/service_categories": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Service Categories",
        "description": "Retrieve Service Categories for a Location as JSON:API resource objects.\n\nUse `filter[staff_id]` to return categories containing Services assigned to\na specific Team Member.\n",
        "operationId": "list_service_categories",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[staff_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by Team Member ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Service Categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/service_category_resource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "service_category",
                      "id": "5",
                      "attributes": {
                        "title": "Hair Services",
                        "salon_service_id": 353
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Service Categories for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendance_services": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Attendance Services",
        "description": "Retrieve Service delivery options for the Location timetable. Each result\ncombines a Service with its applicable Team Member, duration, price, and\ncomposite Service context.\n\nThe response is paginated and includes pagination metadata.\n",
        "operationId": "list_attendance_services",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "team_member_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by Team Member ID"
          },
          {
            "name": "filter[category_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by Service Category ID"
          },
          {
            "name": "filter[service_ids][]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Filter by Service IDs"
          },
          {
            "name": "filter[term]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3
            },
            "description": "Search Service names; surrounding whitespace is ignored"
          },
          {
            "name": "filter[is_available_for_timetable]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            },
            "description": "Filter by timetable availability"
          },
          {
            "name": "filter[is_multi]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            },
            "description": "Filter by multi-Service availability"
          },
          {
            "name": "filter[is_composite]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            },
            "description": "Filter by composite Service status"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Attendance Services to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance Services retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/attendance_service_resource"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "pagination"
                      ],
                      "properties": {
                        "pagination": {
                          "$ref": "#/components/schemas/pagination"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "attendance_service",
                      "id": "720441_13245586_0_0",
                      "attributes": {
                        "company_id": 720441,
                        "service_id": 13245586,
                        "category_id": 5,
                        "is_composite": false,
                        "composite_service_id": 0,
                        "salon_service_id": 8842,
                        "composite_position": null,
                        "staff_id": 0,
                        "title": "Haircut",
                        "length": 3600,
                        "duration": 3600,
                        "price_min": 50,
                        "price_max": 75,
                        "technical_break_duration": 0
                      }
                    }
                  ],
                  "meta": {
                    "pagination": {
                      "page": 1,
                      "offset": 0,
                      "limit": 250
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No access to this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter or pagination value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/composite_services/{service_id}/attendance_services": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Composite Service Attendance Services",
        "description": "Retrieve the Service delivery options that make up a composite Service in\na Location, including Team Member, duration, price, and position data.\n",
        "operationId": "list_composite_service_attendance_services",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "service_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Composite Service ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Composite Service Attendance Services retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/attendance_service_resource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "attendance_service",
                      "id": "720441_13245587_2969872_13160812_1",
                      "attributes": {
                        "company_id": 720441,
                        "service_id": 13245587,
                        "category_id": 5,
                        "is_composite": false,
                        "composite_service_id": 13160812,
                        "salon_service_id": 8843,
                        "composite_position": 1,
                        "staff_id": 2969872,
                        "title": "Wash and Cut",
                        "length": 3600,
                        "duration": 3600,
                        "price_min": 50,
                        "price_max": 50,
                        "technical_break_duration": 0
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No access to this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Composite Service or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid path parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendance_service_suggestions": {
      "get": {
        "tags": [
          "Services"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Attendance Service Suggestions",
        "description": "Retrieve Service suggestions for a Team Member. Supplying a Booking User\nID adds suggestions based on that Booking User's prior Appointments and\npopular Services.\n\nUse `include=attendance_service` or `include=record` to include the\nsuggested Service delivery option or source Appointment. The literal\n`record` include value is retained by the wire contract.\n",
        "operationId": "list_attendance_service_suggestions",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "team_member_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Team Member ID"
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Booking User profile ID; `client_id` is the literal wire name"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "attendance_service",
                  "record"
                ]
              }
            },
            "description": "Related Attendance Service or source Appointment to include"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance Service suggestions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/attendance_service_suggestion_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/attendance_service_resource"
                          },
                          {
                            "$ref": "#/components/schemas/includedResource"
                          }
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "attendance_service_suggestion",
                      "id": "13245586",
                      "attributes": {
                        "service_id": 13245586,
                        "suggestion_type": "master_popular_service",
                        "record_id": null
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No access to the Location or Booking User",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location, Team Member, or Booking User not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/units": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Product Units",
        "description": "Retrieve the measurement Units available to Products in a Location as\nJSON:API resource objects. The collection contains shared system Units and\nany Units configured specifically for the Location.\n\nUse Unit IDs as `sale_unit_id` and `consumable_unit_id` in Product data.\n",
        "operationId": "list_product_units",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Product Units retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/unit_resource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "unit",
                      "id": "1",
                      "attributes": {
                        "company_id": 0,
                        "title": "Piece",
                        "short_title": "pc"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Product Units for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Products",
        "description": "Retrieve Products for a Location as JSON:API resource objects.\n\nPagination uses `page` and `limit`. The response includes the effective\n`page`, calculated `offset`, and `limit` in `meta.pagination`.\n\nRelated data can be requested by repeating the `include` parameter. The\n`actual_cost` value is returned only when requested and when the Business\nUser has permission to view it.\n",
        "operationId": "list_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[ids][]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Filter by Product IDs"
          },
          {
            "name": "filter[related_loyalty_entity_slug]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "common",
                "loyalty_abonement",
                "loyalty_certificate"
              ],
              "default": "common"
            },
            "description": "Filter by Product purpose. Wire values are literal API values:\n- `common` - regular Products\n- `loyalty_abonement` - membership Products\n- `loyalty_certificate` - gift card Products\n"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Products to return"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "loyalty_abonement_type",
                  "loyalty_certificate_type",
                  "mark_settings",
                  "actual_cost"
                ]
              }
            },
            "description": "Related resources or conditional attributes to include. Wire values are\nliteral API keys. Use the Product detail operation for `storage_amounts`.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Products retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/product_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "pagination"
                      ],
                      "properties": {
                        "pagination": {
                          "$ref": "#/components/schemas/pagination"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "good",
                      "id": "100",
                      "attributes": {
                        "category_id": 5,
                        "title": "Professional Shampoo",
                        "sale_unit_id": 1,
                        "consumable_unit_id": 1,
                        "sale_unit_to_consumable_unit_ratio": 1,
                        "loyalty_abonement_type_id": null,
                        "loyalty_certificate_type_id": null,
                        "cost": 25.99,
                        "actual_cost": null,
                        "is_chain": false
                      }
                    }
                  ],
                  "meta": {
                    "pagination": {
                      "page": 1,
                      "offset": 0,
                      "limit": 250
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Products for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter, pagination, or include value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/products/autocomplete": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Autocomplete Products",
        "description": "Search Products by name, article number, or barcode.\n\nThe search term must contain at least two characters and cannot contain\nemoji. Pagination uses `page` and `limit` and is returned in\n`meta.pagination`.\n",
        "operationId": "autocomplete_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[term]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2
            },
            "description": "Product name, article number, or barcode search term"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Products to return"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "loyalty_abonement_type",
                  "loyalty_certificate_type",
                  "mark_settings"
                ]
              }
            },
            "description": "Related resources to include; wire values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Products retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/product_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "pagination"
                      ],
                      "properties": {
                        "pagination": {
                          "$ref": "#/components/schemas/pagination"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Search term contains emoji",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to search Products for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid search term, pagination, or include value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/products/{product_id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Product",
        "description": "Retrieve a Product for a Location as a JSON:API resource object.\n\nRelated data can be requested by repeating the `include` parameter. The\n`actual_cost` value is returned only when requested and when the Business\nUser has permission to view it.\n",
        "operationId": "get_product",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Product ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "loyalty_abonement_type",
                  "loyalty_certificate_type",
                  "mark_settings",
                  "storage_amounts",
                  "actual_cost"
                ]
              }
            },
            "description": "Related resources or conditional attributes to include"
          }
        ],
        "responses": {
          "200": {
            "description": "Product retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/product_resource"
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "good",
                    "id": "100",
                    "attributes": {
                      "category_id": 5,
                      "title": "Professional Shampoo",
                      "sale_unit_id": 1,
                      "consumable_unit_id": 1,
                      "sale_unit_to_consumable_unit_ratio": 1,
                      "loyalty_abonement_type_id": null,
                      "loyalty_certificate_type_id": null,
                      "cost": 25.99,
                      "actual_cost": null,
                      "is_chain": false
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read this Product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Product or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/products/{product_id}/storage_amounts": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Product Storage Amounts",
        "description": "Retrieve Product amounts across the Location's Storages as JSON:API\nresource objects. Amounts are returned in both Sale Units and Consumable\nUnits.\n",
        "operationId": "list_product_storage_amounts",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Product ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "storage"
                ]
              }
            },
            "description": "Include Storage details; `storage` is the literal wire value"
          }
        ],
        "responses": {
          "200": {
            "description": "Product Storage amounts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/storage_amount_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Storage resources requested through `include`",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "good_storage_amount",
                      "id": "100_10",
                      "attributes": {
                        "good_id": 100,
                        "storage_id": 10,
                        "sale_amount": 50,
                        "consumable_amount": 50
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Product amounts for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Product or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/product_categories": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Product Categories",
        "description": "Retrieve Product Categories for a Location as JSON:API resource objects.\n\nOmit `filter[parent_category_id]` or set it to `0` to return root Product\nCategories. Set it to a Product Category ID to return direct children.\n",
        "operationId": "list_product_categories",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[parent_category_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Parent Product Category ID; use `0` for root categories"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "child_categories",
                  "goods"
                ]
              }
            },
            "description": "Related resources to include. `child_categories` and `goods` are\nliteral wire values for Product Categories and Products.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Product Categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/product_category_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "good_category",
                      "id": "5",
                      "attributes": {
                        "title": "Hair Care",
                        "is_chain": false,
                        "parent_category_id": null
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Product Categories for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parent Product Category filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/product_categories/{product_category_id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Product Category",
        "description": "Retrieve a Product Category for a Location as a JSON:API resource object.",
        "operationId": "get_product_category",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "product_category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Product Category ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "child_categories",
                  "goods"
                ]
              }
            },
            "description": "Related resources to include. `child_categories` and `goods` are\nliteral wire values for Product Categories and Products.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Product Category retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/product_category_resource"
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "good_category",
                    "id": "5",
                    "attributes": {
                      "title": "Hair Care",
                      "is_chain": false,
                      "parent_category_id": null
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read this Product Category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Product Category or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendance_product_items/{attendance_product_item_id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Appointment Product Item",
        "description": "Retrieve a Product item associated with an Appointment as a JSON:API\nresource object.\n\nThe positive response shape is verified against the current PHP transformer\nbut has not been live-verified because the test Location has no safe fixture.\n",
        "operationId": "get_attendance_product_item",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "attendance_product_item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Appointment Product Item ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "good",
                  "staff",
                  "storage_amount",
                  "loyalty_abonement",
                  "loyalty_certificate",
                  "marks"
                ]
              }
            },
            "description": "Related resources to include. Wire values are literal API keys;\n`staff` represents the Team Member and `good` represents the Product.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment Product Item retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/attendance_product_item_resource"
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read this Appointment Product Item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Appointment Product Item or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/team_members": {
      "get": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Team Members",
        "description": "Retrieve Team Members for a Location as JSON:API resource objects.\n\nUse the filters to select Team Members by name, Position, account link,\nschedule, payment, dismissal, deletion, or assistant availability. Status\nfilters use `0`, `1`, and `2`, where `2` disables that filter.\n\nRelated data can be requested by repeating the `include` parameter. The\n`employee` wire value returns an employment profile that can contain\nsensitive employment and identity data. Request and store it only when it\nis necessary for the integration.\n",
        "operationId": "list_team_members",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "description": "Filter by a partial Team Member name match"
          },
          {
            "name": "filter[position_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Filter by Position ID"
          },
          {
            "name": "filter[position_title]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "description": "Filter by a partial Position title match"
          },
          {
            "name": "filter[fired]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 2
            },
            "description": "Filter by dismissal status: `0` not dismissed, `1` dismissed, `2` all"
          },
          {
            "name": "filter[deleted]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 0
            },
            "description": "Filter by deletion status: `0` active, `1` deleted, `2` all"
          },
          {
            "name": "filter[user_linked]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 2
            },
            "description": "Filter by Business User link: `0` not linked, `1` linked, `2` all"
          },
          {
            "name": "filter[is_paid]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 2
            },
            "description": "Filter by payment status: `0` unpaid, `1` paid, `2` all"
          },
          {
            "name": "filter[has_schedule]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 2
            },
            "description": "Filter by schedule: `0` without a schedule, `1` with a schedule, `2` all"
          },
          {
            "name": "filter[is_assistant]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 2
            },
            "description": "Filter by assistant availability: `0` unavailable, `1` available, `2` all"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "position",
                  "employee"
                ]
              }
            },
            "description": "Related resources to include. Wire values are literal API keys:\n- `position` - Position\n- `employee` - employment profile\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Team Members retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/team_member_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/position_resource"
                          },
                          {
                            "$ref": "#/components/schemas/employment_profile_resource"
                          }
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "staff",
                      "id": "42",
                      "attributes": {
                        "name": "John Smith",
                        "tt_markup": 15,
                        "specialization": "Senior Stylist",
                        "image": "https://cdn.altegio.com/team-members/42.jpg",
                        "position_id": 5,
                        "is_available_as_assistant": false
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Team Members for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{company_id}/positions": {
      "get": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Positions",
        "description": "Retrieve all Positions available to Team Members at a Location.\n\nThe response is a JSON:API collection and does not contain pagination\nmetadata. The literal `company_id` wire path parameter identifies a\nLocation.\n",
        "operationId": "list_positions",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Positions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/team_member_position_resource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "position",
                      "id": "42",
                      "attributes": {
                        "chain_id": 5,
                        "title": "Senior Stylist",
                        "description": "Senior hair stylist with color specialization",
                        "services_binding_type": 0,
                        "rules_required_fields": [],
                        "only_chain_appointment": false,
                        "salon_ids": [
                          1,
                          2,
                          3
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Positions for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create Position",
        "description": "Create a Position for Team Members at the specified Location.",
        "operationId": "create_position",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Position title"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Position description"
                  }
                }
              },
              "example": {
                "title": "Senior Stylist",
                "description": "Senior hair stylist with color specialization"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Position created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/team_member_position_resource"
                    },
                    "meta": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "position",
                    "id": "42",
                    "attributes": {
                      "chain_id": 5,
                      "title": "Senior Stylist",
                      "description": "Senior hair stylist with color specialization",
                      "services_binding_type": 0,
                      "rules_required_fields": [],
                      "only_chain_appointment": false,
                      "salon_ids": [
                        1
                      ]
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to create Positions for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or unexpected request field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{company_id}/positions/{position_id}": {
      "get": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Position",
        "description": "Retrieve a Position by ID as a JSON:API resource object.",
        "operationId": "get_position",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "position_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Position ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Position retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/team_member_position_resource"
                    },
                    "meta": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "position",
                    "id": "42",
                    "attributes": {
                      "chain_id": 5,
                      "title": "Senior Stylist",
                      "description": "Senior hair stylist with color specialization",
                      "services_binding_type": 0,
                      "rules_required_fields": [],
                      "only_chain_appointment": false,
                      "salon_ids": [
                        1,
                        2,
                        3
                      ]
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read the Position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Position not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Update Position",
        "description": "Update a Position. The request must contain `title`.",
        "operationId": "update_position",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "position_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Position ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Position title"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Position description"
                  }
                }
              },
              "example": {
                "title": "Senior Stylist Updated",
                "description": "Updated description"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Position updated successfully; no response body"
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to update the Position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Position not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or unexpected request field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Team Members"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete Position",
        "description": "Delete a Position.",
        "operationId": "delete_position",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "position_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Position ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Position deleted successfully; no response body"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to delete the Position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Position not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendances/{attendance_id}/appointments": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Attendance Appointments",
        "description": "Retrieve Appointments grouped under one attendance identifier as JSON:API\nresource objects.\n\nUse `record_{appointment_id}` to retrieve the group containing one\nAppointment, or `visit_{visit_id}` to retrieve all Appointments linked to\none visit. The `attendance_id` path parameter and both prefixes are literal\nwire values.\n\nRelated data can be requested by repeating the `include` parameter. Wire\nvalues remain literal API keys: `client` identifies Booking User data,\n`staff` identifies Team Member data, and `goods` identifies Products.\nCustom Field Value includes require the corresponding Business User\npermissions.\n\nThis is the read for\n[Save Visit Appointments](#tag/Appointments/operation/save_attendance_appointments),\nwhich replaces whole Appointments. Nested includes such as\n`attendance_good_items.marks`, `attendance_good_items.loyalty_abonement`,\n`attendance_good_items.loyalty_certificate`, and\n`attendance_service_items.assistants` return the keys that operation\nrequires you to echo.\n",
        "operationId": "list_attendance_appointments",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "attendance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(record|visit)_[0-9]+$",
              "example": "record_12345"
            },
            "description": "Attendance group identifier. Use the literal `record_` prefix with an\nAppointment ID or the literal `visit_` prefix with a visit ID.\n"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/attendance_include"
            },
            "description": "Related resources to include; values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance Appointments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/appointment_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Appointments for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Attendance group or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid attendance identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendance/appointments": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Save Visit Appointments",
        "description": "Save one or more Appointments of one visit together with their Service\nlines and Product Items. The web app calls this operation when a Business\nUser clicks **Save** in the appointment window.\n\n> **This is a replace operation.** Each object in `records` replaces the\n> whole Appointment it identifies: date, Team Member, duration, resources,\n> Tags, color, comment, walk-in visitor, Custom Fields, reminder settings,\n> assistants, Service lines, and Product Items. There is no append or\n> partial update. Read the visit first and send every key back exactly as\n> read, changing only what you mean to change.\n\nThe legacy path `POST /companies/{company_id}/attendance/records` reaches\nthe same handler. It is deprecated since 2026-07-01 and sunsets on\n2027-03-01; use the canonical path. The v3 operation\n[`addVisitItem`](../b2b-v3/openapi.yaml#tag/Visits/operation/addVisitItem)\nis planned as the append-only contract for adding one Product Item to a\nvisit. It is not served yet.\n\n### Read, modify, write\n\n1. Read the visit with\n   [List Attendance Appointments](#tag/Appointments/operation/list_attendance_appointments),\n   using `attendance_id` = `record_{appointment_id}` and these includes:\n   `attendance_service_items`, `attendance_service_items.assistants`,\n   `attendance_service_items.attendance_service_composite.composite_service`,\n   `attendance_good_items`, `attendance_good_items.marks`,\n   `attendance_good_items.loyalty_abonement`,\n   `attendance_good_items.loyalty_certificate`, `resource_instances`,\n   `labels`, `comer`, `custom_field_values`, `client_notification_settings`,\n   and `duration_details`.\n2. Build one record for each Appointment you change, using the mapping\n   below. Leave the other Appointments of the visit out.\n3. To add a Product Item, append a line with `id: null`. Keep every existing\n   line with its `id` and its values unchanged.\n4. Send `is_instant_sms_notification_required: false` and\n   `ignore_conflicts: false`.\n5. Request `include: [\"attendance_good_items\"]` and read the Product Items\n   back from the response: loyalty programs may change their totals after\n   the save.\n\n| Request key | Source in the read |\n|---|---|\n| `id`, `external_id`, `staff_id`, `date`, `duration`, `comment`, `custom_color`, `clients_count`, `attendance_status_slug` | Appointment attributes with the same names |\n| `client_id` | Appointment `client_id`; `null` when it is `0` |\n| `technical_break_duration` | `duration_details.technical_break_duration` |\n| `resource_instance_ids`, `label_ids` | IDs of the included `resource_instances` and `labels` |\n| `comer` | Included `comer` (`id`, `title`) plus `slug` and `type`; `null` when absent |\n| `custom_field_values` | Included `custom_field_values` as `code` and `value` |\n| `client_notification_settings` | Included `client_notification_settings` |\n| `assistants` | `attendance_service_items.assistants`, with the line's `service_id` |\n| `attendance_service_items[]` | `id`, `service_id`, `quantity`, `cost_per_unit`, `manual_cost`, `discount_percent`; `composite_service_id` from the composite include |\n| `attendance_good_items[]` | `id`, `good_id`, `unit_id`, `storage_id`, `staff_id`, `quantity`, `cost_per_unit`, `manual_cost`, `discount_percent`; `operation_unit_type` from `operation_type_slug`; `number` and `planned_activation_date` from the loyalty includes; `marks` |\n\n`date` is Location wall-clock time without an offset. Echo it exactly;\nnever derive it from `timestamp`.\n\n### Product Item fields\n\n- `quantity` is in sale units and positive.\n- `cost_per_unit` is the unit price before discount. For a new line, use\n  the Product's sale price.\n- `discount_percent` is the line discount in percent.\n- `manual_cost` is the line total after `discount_percent` and before\n  loyalty programs: `round(cost_per_unit × quantity × (100 − discount_percent) / 100, 2)`.\n  Echo the read's `manual_cost`, never its `cost`, which already includes\n  loyalty discounts.\n- `operation_unit_type` is `sale` (sold to the Booking User) or\n  `consumable` (written off as a Service consumable).\n- `storage_id` is the Inventory the Product is written off from, and\n  `staff_id` is the Team Member credited with the sale. The web app uses\n  the Appointment's Team Member.\n\n### What a save changes\n\n- Expect every record you send to be re-saved in full, even when you echo\n  it exactly. The change detection treats an Appointment without a walk-in\n  visitor or without a color as changed, so most exact echoes still\n  re-save the Appointment. Only a record that passes every check is\n  skipped, and then only its Product Items are synchronized.\n- A Service or Product Item line without `id` is created. An existing line\n  that is missing from the request is deleted, together with any gift card\n  or membership it issued. `attendance_good_items: []` deletes every\n  Product Item of the Appointment.\n- Omitting `assistants` removes the Appointment's assistants, and\n  `comer: null` removes its walk-in visitor. `custom_field_values: null`\n  and `custom_color: null` keep the stored values.\n- The visit's Product Items are saved as one list. Product Items of other\n  Appointments in the visit are kept, but they are re-saved and go through\n  the loyalty recalculation again; read them back too. *Inferred from the\n  code, not verified:* the re-save sends each kept line's after-loyalty\n  total as its new pre-loyalty total, so a loyalty discount on those lines\n  may be applied twice, and it does not carry a membership's planned\n  activation date, so a visit with a specific-date membership on another\n  Appointment may fail to save. Prefer visits with a single Appointment\n  when loyalty programs discount Products.\n\n### Preconditions and refusals\n\n- **Status.** Product Items require the visit status arrived (`1`) or\n  confirmed (`2`). Any other status normally returns `403` with a message\n  that product sales are restricted for this status. If no record in the\n  request counts as changed, the request instead returns `200`, saves\n  none of the Product Items, and deletes every Product Item of the visit.\n  Check the status before you send.\n- **Arrived side effects.** Changing the status to arrived (`1`) runs\n  loyalty auto-programs, writes off Service consumables, and reschedules\n  the Booking User's repeat-visit reminders. Changing it to no-show (`-1`)\n  sends the cancellation notice.\n- **Printed bill.** When the visit's sale bill is printed, including a\n  pending fiscal pre-save, Product Item changes return `400`.\n- **Stock.** When the Location forbids negative stock, a line that would\n  take an Inventory below zero returns `406`. Otherwise stock may go\n  negative.\n- **Gift cards and memberships.** A gift card needs `number` unless its\n  type allows an empty code; a used number, a number outside the type's\n  list, or an archived type is refused. A membership whose type expires on\n  a specific date needs `planned_activation_date`. Existing gift card and\n  membership lines must be echoed with the same `number` and\n  `planned_activation_date`; otherwise the save fails or re-issues the\n  gift card or membership.\n- **Marks.** Each goods marking code in `marks` is at most 256 characters.\n- **Group Events.** An Event Appointment is accepted only with exactly one\n  unchanged Service line and a `clients_count` within the Event capacity;\n  otherwise `400`. Use\n  [Update Event Appointment](#tag/Events/operation/update_event_appointment)\n  for Event Appointments.\n- **One visit per request.** All records must belong to one visit and one\n  Booking User and must not set different new statuses; otherwise `400`.\n  A deleted Appointment returns `404`. An Appointment waiting for an\n  online prepayment cannot be changed.\n- **Conflicts.** Unless `ignore_conflicts` is `true`, a busy time slot, a\n  Team Member who does not provide the Services, a busy resource, a deleted\n  Team Member, or removal of a prepaid Service returns `409`.\n\n### Side effects\n\n- Every save sends the partner webhook \"record update\" for every\n  Appointment of the visit and a push to the Team Member apps, even when\n  only Product Items changed.\n- A changed date (beyond the Location's threshold), Team Member, or set of\n  Services sends the Booking User a \"record changed\" message. Adding a\n  Product Item alone sends no message.\n- A Product Item change re-applies the Booking User's loyalty card discount\n  programs to the visit. The saved `discount_percent`, `manual_cost`, and\n  `cost` may differ from the request.\n\n### Permissions\n\nThe Business User needs the right to create or edit Appointments. Product\nItems also check the following rights, each returning `403`:\n\n- creating Product sales in Appointments, with its day limit, for a new\n  line;\n- editing Product sales, their price, and their discount, with the edit\n  day limit, for a changed line;\n- editing arrived Appointments, and editing fully paid arrived or\n  confirmed Appointments.\n\nChanges to the date or Team Member, Services, the comment, Service prices\nor discounts, and penalty decisions check their own rights.\n",
        "operationId": "save_attendance_appointments",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attendance_save_request"
              },
              "example": {
                "ignore_conflicts": false,
                "include": [
                  "attendance_good_items"
                ],
                "records": [
                  {
                    "id": 67890,
                    "external_id": "",
                    "client_id": 23456,
                    "staff_id": 34567,
                    "date": "2026-10-12T14:00:00",
                    "duration": 3600,
                    "technical_break_duration": 0,
                    "comment": "",
                    "custom_color": "",
                    "attendance_status": 1,
                    "label_ids": [],
                    "resource_instance_ids": [],
                    "custom_field_values": null,
                    "comer": null,
                    "client_notification_settings": {
                      "sms_hours_before_visit": 0,
                      "email_hours_before_visit": 0
                    },
                    "is_instant_sms_notification_required": false,
                    "clients_count": 1,
                    "assistants": [],
                    "attendance_service_items": [
                      {
                        "id": 111222,
                        "service_id": 45678,
                        "quantity": 1,
                        "cost_per_unit": 50,
                        "manual_cost": 50,
                        "discount_percent": 0,
                        "composite_service_id": null
                      }
                    ],
                    "attendance_good_items": [
                      {
                        "id": 333444,
                        "good_id": 56789,
                        "unit_id": 101,
                        "storage_id": 202,
                        "staff_id": 34567,
                        "operation_unit_type": "sale",
                        "number": null,
                        "planned_activation_date": null,
                        "marks": [],
                        "quantity": 1,
                        "cost_per_unit": 20,
                        "manual_cost": 18,
                        "discount_percent": 10
                      },
                      {
                        "id": null,
                        "good_id": 56790,
                        "unit_id": 101,
                        "storage_id": 202,
                        "staff_id": 34567,
                        "operation_unit_type": "sale",
                        "number": null,
                        "planned_activation_date": null,
                        "marks": [],
                        "quantity": 2,
                        "cost_per_unit": 12.5,
                        "manual_cost": 25,
                        "discount_percent": 0
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Appointments saved. `data` lists every Appointment of the affected\nvisits, including Appointments that were not in the request.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/appointment_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Business rule refused the save: records from different visits or\nBooking Users, different new statuses, a Service total that does not\nmatch its discount, a printed bill, a gift card or membership rule, an\nEvent Appointment rule, or an Appointment waiting for prepayment\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - missing Appointment, Product sale, price, discount, or\nstatus right, a day limit, or a product sale in a status other than\narrived or confirmed\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Appointment not found, or the Appointment is deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "406": {
            "description": "Not enough stock in the Inventory, and the Location forbids negative stock",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "409": {
            "description": "Scheduling conflict; resend with `ignore_conflicts` to override",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed, a Product Item `id` does not belong to the\nAppointment, or a payment policy blocks the status change\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/appointments": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Appointments",
        "description": "Retrieve Appointments for a Location as JSON:API resource objects.\n\nPagination uses `page` and `limit`. The response includes the effective\n`page`, calculated `offset`, and `limit` in `meta.pagination`.\n\nDate range values use `YYYY-MM-DDTHH:MM:SS` without a timezone. Provide\n`filter[date_intersect_from]` and `filter[date_intersect_to]` together; the\nend must be later than the start.\n\nRelated data can be requested by repeating the `include` parameter. Wire\nvalues remain literal API keys: `client` identifies Booking User data,\n`staff` identifies Team Member data, and `goods` identifies Products.\nCustom Field Value includes require the corresponding Business User\npermissions.\n",
        "operationId": "list_appointments",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[client_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by Booking User profile ID"
          },
          {
            "name": "filter[activity_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by Event ID"
          },
          {
            "name": "filter[date_intersect_from]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
              "example": "2026-01-01T00:00:00"
            },
            "description": "Start of the Appointment intersection range, without a timezone"
          },
          {
            "name": "filter[date_intersect_to]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
              "example": "2026-01-31T23:59:59"
            },
            "description": "End of the Appointment intersection range, without a timezone"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Appointments to return"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/include"
            },
            "description": "Related resources to include; values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Appointments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/appointment_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "pagination"
                      ],
                      "properties": {
                        "pagination": {
                          "$ref": "#/components/schemas/pagination"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "record",
                      "id": "12345",
                      "attributes": {
                        "company_id": 1,
                        "external_id": "",
                        "visit_id": 0,
                        "booking_user_id": 100,
                        "bookform_id": 3,
                        "master_id": 42,
                        "staff_id": 42,
                        "client_id": 500,
                        "comer_id": null,
                        "source": 12,
                        "attendance": 0,
                        "attendance_status": 0,
                        "attendance_status_slug": "waiting",
                        "client_fictive_name": null,
                        "client_fictive_phone": null,
                        "client_fictive_email": null,
                        "clients_count": 1,
                        "activity_id": 0,
                        "custom_color": "",
                        "custom_font_color": "",
                        "length": 3600,
                        "duration": 3600,
                        "paid_full": 0,
                        "is_paid": false,
                        "is_overpaid": false,
                        "timestamp": 1768467600,
                        "date": "2026-01-15T10:00:00",
                        "created_datetime": "2026-01-10T15:30:00",
                        "from_url": "",
                        "is_mobile": 0,
                        "comment": "",
                        "prepaid_status": 0,
                        "record_from": "API",
                        "payment_status": null,
                        "is_sale_bill_printed": null,
                        "is_client_notification_sent": false
                      }
                    }
                  ],
                  "meta": {
                    "pagination": {
                      "page": 1,
                      "offset": 0,
                      "limit": 250
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read Appointments for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter or pagination value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/appointments/{appointment_id}": {
      "delete": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete Appointment",
        "description": "Delete an Appointment. The Business User must have permission to delete\nAppointments for the Location and permission to delete this Appointment.\n",
        "operationId": "delete_appointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Appointment ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Appointment deleted successfully; no response body"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to delete the Appointment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Appointment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/timetable/appointments/delete": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete Timetable Appointment",
        "description": "Delete one Appointment from the timetable by its `appointmentId`.\n\nIf the deleted Appointment belongs to a linked visit, the response returns\nthe remaining related Appointments as a JSON:API collection. Deleting an\nAppointment without related Appointments returns an empty `data` array.\n",
        "operationId": "delete_timetable_appointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/include"
            },
            "description": "Related resources to include in returned Appointments"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "appointmentId"
                ],
                "properties": {
                  "appointmentId": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Appointment ID"
                  }
                }
              },
              "example": {
                "appointmentId": 12345
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Appointment deleted; remaining related Appointments returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/appointment_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    }
                  }
                },
                "example": {
                  "data": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to delete the Appointment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Appointment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/resource_occupations": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Resource Occupations",
        "description": "Retrieve resource occupations that intersect a required time interval in a\nLocation. Results can be narrowed to one or more Services.\n\nEach JSON:API resource identifies the occupied resource instance, its time\ninterval, and the source Appointment or Event.\n",
        "operationId": "list_resource_occupations",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[service_id]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Filter by one Service ID"
          },
          {
            "name": "filter[service_ids][]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Filter by multiple Service IDs"
          },
          {
            "name": "filter[date_intersect_from_strict]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$"
            },
            "description": "Interval start in the Location timezone, without an offset"
          },
          {
            "name": "filter[date_intersect_to_strict]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$"
            },
            "description": "Interval end in the Location timezone, without an offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Resource occupations retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/resource_occupation_resource"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "resource_occupation",
                      "id": "501",
                      "attributes": {
                        "source_type": "record",
                        "source_type_slug": "record",
                        "source_id": 7001,
                        "resource_id": 90,
                        "resource_instance_id": 901,
                        "from": "2026-07-16 13:00:00",
                        "to": "2026-07-16 13:30:00"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No timetable access for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter value or date format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Events",
        "description": "Retrieve Events for a Location within a future date range. The response is\na JSON:API collection with the literal resource type `activity`.\n\n`filter[from]` must not be earlier than the current time, and `filter[to]`\nmust be later than `filter[from]`.\n",
        "operationId": "list_events",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "filter[from]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
              "example": "2026-08-01 09:00:00"
            },
            "description": "Range start in the Location timezone as `YYYY-MM-DD HH:MM:SS`"
          },
          {
            "name": "filter[to]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
              "example": "2026-08-07 21:00:00"
            },
            "description": "Range end in the Location timezone as `YYYY-MM-DD HH:MM:SS`"
          },
          {
            "name": "filter[master_ids][]",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Team Member IDs; the literal wire query key is `filter[master_ids][]`"
          },
          {
            "name": "filter[service_ids][]",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "integer",
                "minimum": 1
              }
            },
            "description": "Service IDs"
          },
          {
            "name": "filter[capacity]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Minimum number of unoccupied places"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Result page"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of Events to return"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/event_include"
            },
            "description": "Related resources to include; values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Events retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_collection_response"
                }
              }
            }
          },
          "400": {
            "description": "Required date range is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No timetable permission for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid date range, filter, or pagination value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create Event",
        "description": "Create a group Event for a Location.",
        "operationId": "create_event",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/event_include"
            },
            "description": "Related resources to include in the created Event"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/event_create_request"
              },
              "example": {
                "team_member_id": 42,
                "service_id": 500,
                "resource_instance_ids": [],
                "label_ids": [],
                "date": "2026-08-01 14:00:00",
                "length": 3600,
                "technical_break_duration": 300,
                "capacity": 8,
                "comment": "Beginner group session",
                "color": "#9c27b0",
                "instructions": "Arrive ten minutes early",
                "stream_link": "https://example.com/event-stream",
                "force": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Event created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_item_response"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to create Events",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location, Team Member, or Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "409": {
            "description": "Team Member or Resource Instance is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/events/dates": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List event dates",
        "operationId": "list_event_dates",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter[from]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-16 00:00:00"
            }
          },
          {
            "name": "filter[to]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-31 23:59:59"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dates containing matching events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "description": "One JSON:API resource per date that has at least one matching event",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "example": "activity_date"
                          },
                          "id": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-18"
                          },
                          "attributes": {
                            "type": "object",
                            "required": [
                              "date"
                            ],
                            "properties": {
                              "date": {
                                "type": "string",
                                "format": "date",
                                "example": "2026-07-18"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/dates/range": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get matching event date range",
        "operationId": "get_event_date_range",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter[from]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-16 00:00:00"
            }
          },
          {
            "name": "filter[to]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-31 23:59:59"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Earliest and latest matching event dates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "type",
                        "id",
                        "attributes"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "activity_dates_range"
                        },
                        "id": {
                          "type": "string",
                          "description": "Location ID",
                          "example": "123"
                        },
                        "attributes": {
                          "type": "object",
                          "required": [
                            "min_date",
                            "max_date"
                          ],
                          "properties": {
                            "min_date": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date",
                              "example": "2026-07-18"
                            },
                            "max_date": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date",
                              "example": "2026-07-29"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0,
                      "description": "Empty JSON array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/filters": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List available event filters",
        "operationId": "list_event_filters",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter[from]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-16 00:00:00"
            }
          },
          {
            "name": "filter[to]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-07-31 23:59:59"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON:API collection of available filter values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "activity_filter"
                          },
                          "id": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "relationships": {
                            "type": "object",
                            "description": "Wire relationship named `data`; its `data` member is `null` in list responses",
                            "example": {
                              "data": {
                                "data": null
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/duplication_strategies": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List event duplication strategies",
        "operationId": "list_event_duplication_strategies_v2",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON:API collection of duplication strategies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "activity_duplication_strategy"
                          },
                          "id": {
                            "type": "string"
                          },
                          "attributes": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      },
      "post": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create an event duplication strategy",
        "operationId": "create_event_duplication_strategy_v2",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "repeat_mode_id"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "repeat_mode_id": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7
                  },
                  "days": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6
                    }
                  },
                  "interval": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "content_type": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Duplication strategy created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "type",
                        "id",
                        "attributes"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "activity_duplication_strategy"
                        },
                        "id": {
                          "type": "string"
                        },
                        "attributes": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0,
                      "description": "Empty JSON array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/duplication_strategies/{strategy_id}": {
      "put": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Update an event duplication strategy",
        "operationId": "update_event_duplication_strategy_v2",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "strategy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "repeat_mode_id": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7
                  },
                  "days": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6
                    }
                  },
                  "interval": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "content_type": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated strategy in JSON:API format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "type",
                        "id",
                        "attributes"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "activity_duplication_strategy"
                        },
                        "id": {
                          "type": "string"
                        },
                        "attributes": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0,
                      "description": "Empty JSON array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      },
      "delete": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete an event duplication strategy",
        "operationId": "delete_event_duplication_strategy_v2",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "strategy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Strategy deleted"
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/{event_id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Event",
        "description": "Return one Event in JSON:API format. Event deletion is soft: a deleted Event\nis excluded from list results, while direct retrieval remains available.\n",
        "operationId": "get_event",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Event ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/event_include"
            },
            "description": "Related resources to include; values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Event retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_item_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No access to this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Update Event",
        "description": "Replace the mutable properties of an Event.",
        "operationId": "update_event",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Event ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/event_include"
            },
            "description": "Related resources to include in the updated Event"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/event_update_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_item_response"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to update the Event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location, Event, Team Member, or Service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "409": {
            "description": "Team Member or Resource Instance is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete Event",
        "description": "Soft-delete an Event. The Event is removed from list results, and no\nresponse body is returned.\n",
        "operationId": "delete_event",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Event ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Event deleted successfully; no response body"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to delete the Event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/events/{event_id}/duplicate": {
      "post": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Duplicate an event to selected dates",
        "operationId": "duplicate_event",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dates"
                ],
                "properties": {
                  "dates": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "description": "Every item must be ISO 8601 (`2026-07-20T10:00:00` or `2026-07-20T10:00:00+0300`); one invalid date rejects the whole request with 422",
                    "items": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-07-20T10:00:00"
                    }
                  },
                  "content_type": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ],
                    "default": 1
                  },
                  "force": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "JSON:API collection of created events"
          },
          "400": {
            "description": "Invalid duplication request"
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          },
          "409": {
            "description": "A team member or resource is busy"
          }
        }
      }
    },
    "/locations/{location_id}/events/{event_id}/appointments": {
      "post": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create Event Appointment",
        "description": "Create an Appointment in an Event. The literal `client` wire object is\nrequired for both an existing and a new Booking User.\n",
        "operationId": "create_event_appointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Event ID"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/include"
            },
            "description": "Related resources to include in the created Appointment"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/event_appointment_create_request"
              },
              "example": {
                "client_id": 123456,
                "client": {
                  "id": 123456,
                  "name": "John",
                  "phone": "13155550175",
                  "email": "john@example.com",
                  "surname": "Smith",
                  "patronymic": null,
                  "gender": 1,
                  "birthday": "1990-01-01",
                  "custom_field_values": null,
                  "agreements": null
                },
                "comer_id": null,
                "clients_count": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Event Appointment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_appointment_item_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to create Appointments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location or Event not found, including a deleted Event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/events/{event_id}/appointments/bulk": {
      "post": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create multiple event appointments",
        "operationId": "bulk_create_event_appointments",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "records"
                ],
                "properties": {
                  "records": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "properties": {
                        "client_id": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "name": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string",
                          "format": "email"
                        },
                        "clients_count": {
                          "type": "integer",
                          "minimum": 0,
                          "default": 1
                        },
                        "send_sms_now": {
                          "type": "integer"
                        },
                        "sms_hour": {
                          "type": "integer"
                        },
                        "email_hour": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Per-record creation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "description": "Created appointments as JSON:API `record` resources, same attributes as the single appointment creation",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "example": "record"
                          },
                          "id": {
                            "type": "string",
                            "example": "624798251"
                          },
                          "attributes": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "required": [
                        "errors"
                      ],
                      "properties": {
                        "errors": {
                          "type": "array",
                          "description": "Records that were not created; the others are created regardless",
                          "items": {
                            "type": "object",
                            "required": [
                              "index",
                              "phone",
                              "name",
                              "error"
                            ],
                            "properties": {
                              "index": {
                                "type": "integer",
                                "description": "Position of the record in the request `records` array",
                                "example": 1
                              },
                              "phone": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "error": {
                                "type": "string",
                                "description": "Localized reason"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401_unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403_forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404_not_found"
          }
        }
      }
    },
    "/locations/{location_id}/events/{event_id}/appointments/{record_id}": {
      "put": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Update Event Appointment",
        "description": "Update pricing, Product Items, Tags, color, comment, or capacity for an Event Appointment.",
        "operationId": "update_event_appointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Event ID"
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Appointment ID; `record_id` is the literal wire path parameter"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/include"
            },
            "description": "Related resources to include in the updated Appointment"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/event_appointment_update_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event Appointment updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_appointment_item_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to update the Appointment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location, Event, or Appointment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Events"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Reschedule Event Appointment",
        "description": "Move an Appointment from this Event to another Event in the same Location.",
        "operationId": "reschedule_event_appointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            },
            "description": "Request media type"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Location ID"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Source Event ID"
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Appointment ID; `record_id` is the literal wire path parameter"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/include"
            },
            "description": "Related resources to include in the rescheduled Appointment"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/event_appointment_reschedule_request"
              },
              "example": {
                "reschedule_activity_id": 12346,
                "with_comer": true,
                "clients_count": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event Appointment rescheduled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_appointment_item_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to move the Appointment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location, source Event, destination Event, or Appointment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid destination Event or request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/attendance/clients/{client_id}": {
      "get": {
        "tags": [
          "Booking Users"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Booking User for Attendance",
        "description": "Retrieve one Booking User profile used by the attendance workflow as a\nJSON:API resource object.\n\nThe `client_id` path parameter and `client` resource type are literal\nlegacy wire names. Optional related data is returned only when requested\nthrough `include` and may require additional Business User permissions or\nenabled Location features.\n",
        "operationId": "get_attendance_booking_user",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Booking User profile ID; `client_id` is the literal wire name"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/booking_user_include"
            },
            "description": "Related resources to include; values are literal API keys"
          }
        ],
        "responses": {
          "200": {
            "description": "Booking User retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/booking_user_resource"
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "$ref": "#/components/schemas/includedResource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to read this Booking User",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Booking User or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid path parameter or unavailable include",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/clients/{client_id}/attendances_statistic": {
      "get": {
        "tags": [
          "Booking Users"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Booking User Location Attendance Statistics",
        "description": "Retrieve attendance counts, financial totals, last successful attendance,\nand Client Accounts for one Booking User in a Location. Statistics remain\navailable for a deleted Booking User profile.\n\nThe `client_id` path parameter and `client_attendances_statistic` resource\ntype are literal legacy wire names.\n",
        "operationId": "get_booking_user_location_attendance_statistics",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Booking User profile ID; `client_id` is the literal wire name"
          }
        ],
        "responses": {
          "200": {
            "description": "Booking User Location attendance statistics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/location_attendance_statistics_resource"
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/deposit_resource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "client_attendances_statistic",
                    "id": "146915197_720441",
                    "attributes": {
                      "company_id": 720441,
                      "successful_attendances_count": 12,
                      "failed_attendances_count": 1,
                      "balance_amount": 40,
                      "spent_amount": 520,
                      "paid_amount": 560,
                      "last_successful_attendance_datetime": "2026-07-15 16:30:00"
                    },
                    "relationships": {
                      "deposits": {
                        "data": []
                      }
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No Booking User access for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Booking User or Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid path parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/clients/{client_id}/chain_attendances_statistic/{chain_id}": {
      "get": {
        "tags": [
          "Booking Users"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Booking User Chain Attendance Statistics",
        "description": "Retrieve attendance counts, financial totals, last successful attendance,\nand Client Accounts for one Booking User across a Chain. The Business User must\nhave Appointment form access configured for the requested Chain.\n\nThe `client_id` path parameter and\n`client_chain_attendances_statistic` resource type are literal legacy wire\nnames.\n",
        "operationId": "get_booking_user_chain_attendance_statistics",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID used to authorize the request"
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Booking User profile ID; `client_id` is the literal wire name"
          },
          {
            "name": "chain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Chain ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Booking User Chain attendance statistics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/chain_attendance_statistics_resource"
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/deposit_resource"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "client_chain_attendances_statistic",
                    "id": "146915197_706028",
                    "attributes": {
                      "chain_id": 706028,
                      "successful_attendances_count": 20,
                      "failed_attendances_count": 2,
                      "balance_amount": 40,
                      "spent_amount": 880,
                      "paid_amount": 920,
                      "last_successful_attendance_datetime": "2026-07-15 16:30:00"
                    },
                    "relationships": {
                      "deposits": {
                        "data": []
                      }
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No Appointment form access for this Chain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Booking User, Location, or Chain not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid path parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}/custom_fields": {
      "get": {
        "tags": [
          "Custom Fields"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Custom Fields",
        "description": "Retrieve Custom Fields configured for Appointments and Booking Users in a\nLocation. Access depends on the Business User's Custom Field permissions.\n\nThe literal `record` and `client` filter values mean Appointment and\nBooking User respectively. `filter[entity_slug]` is a compatibility alias\nfor `filter[parent_entity_type]`.\n",
        "operationId": "list_custom_fields",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "filter[parent_entity_type]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "record",
                "client"
              ]
            },
            "description": "Filter by Appointment or Booking User wire entity value"
          },
          {
            "name": "filter[entity_slug]",
            "in": "query",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string",
              "enum": [
                "record",
                "client"
              ]
            },
            "description": "Compatibility alias for `filter[parent_entity_type]`"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "custom_field_type",
                  "ui_options"
                ]
              }
            },
            "description": "Include Custom Field type or interface options"
          }
        ],
        "responses": {
          "200": {
            "description": "Custom Fields retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/custom_field_resource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "description": "Resources requested through `include`, when available",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/custom_field_type_resource"
                          },
                          {
                            "$ref": "#/components/schemas/custom_field_ui_option_resource"
                          }
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "custom_field",
                      "id": "81",
                      "attributes": {
                        "code": "preferred_color",
                        "slug": "preferred_color",
                        "parent_entity_type": "client",
                        "entity_slug": "client",
                        "relation_entity_type": null,
                        "show_in_ui": true,
                        "is_visible": true,
                        "title": "Preferred color",
                        "user_can_edit": true,
                        "is_editable": true,
                        "is_required": false,
                        "weight": 10,
                        "values": []
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No Custom Field access for this Location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter or include value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error_response"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{company_id}/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "List Tags",
        "description": "Returns all Tags for the specified Location, optionally filtered by entity type.\n\nResponse uses [JSON:API](https://jsonapi.org/) format where `type: \"tag\"` is the resource type name (not to be confused with `entity_type` attribute).\n\n**Entity types:**\n- `common` (0) - General tags\n- `client` (1) - Booking User Tags\n- `record` (2) - Appointment Tags\n- `activity` (3) - Event Tags\n\nUse the `entity` query parameter to filter by type. Accepts both string aliases and numeric values.\n",
        "operationId": "list_tags",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "common",
                "client",
                "record",
                "activity",
                "0",
                "1",
                "2",
                "3"
              ]
            },
            "description": "Filter by entity type (alias or numeric code)",
            "example": "client"
          }
        ],
        "responses": {
          "200": {
            "description": "Tags retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "tag"
                          },
                          "id": {
                            "type": "string",
                            "example": "241625"
                          },
                          "attributes": {
                            "$ref": "#/components/schemas/tag_attributes"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "type": "tag",
                      "id": "241625",
                      "attributes": {
                        "company_id": 68570,
                        "title": "VIP Booking User",
                        "color": "#ff2828",
                        "font_color": "#ffffff",
                        "icon": "star",
                        "entity_type": "client",
                        "is_deleted": false,
                        "is_editable": true
                      }
                    },
                    {
                      "type": "tag",
                      "id": "241626",
                      "attributes": {
                        "company_id": 68570,
                        "title": "Regular Booking User",
                        "color": "#009800",
                        "font_color": "#ffffff",
                        "icon": "user",
                        "entity_type": "client",
                        "is_deleted": false,
                        "is_editable": true
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - No permission to manage this Location",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "description": "Error metadata is open by design. Production may add diagnostic\nfields over time, and local development builds may include\nadditional exception details. API consumers should ignore unknown fields.\n",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Not found"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Create Tag",
        "description": "Creates a new Tag for the specified Location.\n",
        "operationId": "create_tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "title",
                  "color"
                ],
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Tag name",
                    "example": "VIP Booking User"
                  },
                  "color": {
                    "type": "string",
                    "description": "Tag color in",
                    "example": "#ff2828"
                  },
                  "entity": {
                    "type": "integer",
                    "description": "Entity type (0 - general, 1 - Booking User, 2 - Appointment, 3 - Event)",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ],
                    "default": 0
                  },
                  "icon": {
                    "type": "string",
                    "description": "Icon name",
                    "example": "star"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tag created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "tag"
                        },
                        "id": {
                          "type": "string",
                          "example": "241627"
                        },
                        "attributes": {
                          "$ref": "#/components/schemas/tag_attributes"
                        }
                      }
                    },
                    "meta": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "tag",
                    "id": "241627",
                    "attributes": {
                      "company_id": 68570,
                      "title": "VIP Booking User",
                      "color": "#ff2828",
                      "font_color": "#ffffff",
                      "icon": "star",
                      "entity_type": "client",
                      "is_deleted": false,
                      "is_editable": true
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid entity type",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Location not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error - Missing required fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Required parameter title was not passed. Enter a category name"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/locations/{company_id}/tags/{tag_id}": {
      "get": {
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Get Tag",
        "description": "Returns detailed information about a specific Tag.\n\nResponse uses [JSON:API](https://jsonapi.org/) format where `type: \"tag\"` is the resource type name.\n",
        "operationId": "get_tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Tag ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Tag details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "tag"
                        },
                        "id": {
                          "type": "string",
                          "example": "241625"
                        },
                        "attributes": {
                          "$ref": "#/components/schemas/tag_attributes"
                        }
                      }
                    },
                    "meta": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "tag",
                    "id": "241625",
                    "attributes": {
                      "company_id": 68570,
                      "title": "VIP Booking User",
                      "color": "#ff2828",
                      "font_color": "#ffffff",
                      "icon": "star",
                      "entity_type": "client",
                      "is_deleted": false,
                      "is_editable": true
                    }
                  },
                  "meta": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Not found"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Update Tag",
        "description": "Updates an existing Tag.\n",
        "operationId": "update_tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Tag ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Tag name",
                    "example": "VIP Booking User"
                  },
                  "color": {
                    "type": "string",
                    "description": "Tag color in",
                    "example": "#ff2828"
                  },
                  "entity": {
                    "type": "integer",
                    "description": "Entity type (0 - general, 1 - Booking User, 2 - Appointment, 3 - Event)",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ]
                  },
                  "icon": {
                    "type": "string",
                    "description": "Icon name",
                    "example": "star"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Tag updated successfully"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Tag is not editable or belongs to another Location",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Category cannot be changed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Not found"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "BearerPartnerUser": []
          }
        ],
        "summary": "Delete Tag",
        "description": "Deletes a Tag by marking it as deleted.\n",
        "operationId": "delete_tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/accept_header"
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer {partner_token}, User {user_token}"
          },
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Location ID"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Tag ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Tag deleted successfully"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Tag is not editable or belongs to another Location",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "null"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Not found"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}