{
  "openapi": "3.1.0",
  "info": {
    "title": "Angelic Booking API",
    "version": "1.0.0",
    "description": "Business-scoped REST API. Authenticate with an API key from Settings → API access, sent as `Authorization: Bearer <key>`. Each key holds exact scopes (`x:read`, `x:write`, `x:delete` and a few finer ones, listed per operation as `x-scope`); a write scope does not include reading, and some fields (prices, consent, private notes) need an extra scope: see /developers. A key can be limited to certain IP addresses. Rate limit: 120 requests per minute per key by default (set per key); every response carries `X-RateLimit-*` headers."
  },
  "servers": [
    {
      "url": "https://app.angelicbooking.com/api/v1"
    }
  ],
  "tags": [
    {
      "name": "appointments"
    },
    {
      "name": "automations"
    },
    {
      "name": "availability"
    },
    {
      "name": "blocks"
    },
    {
      "name": "business"
    },
    {
      "name": "campaigns"
    },
    {
      "name": "categories"
    },
    {
      "name": "classes"
    },
    {
      "name": "clients"
    },
    {
      "name": "form-submissions"
    },
    {
      "name": "forms"
    },
    {
      "name": "inventory"
    },
    {
      "name": "locations"
    },
    {
      "name": "membership-plans"
    },
    {
      "name": "messages"
    },
    {
      "name": "notifications"
    },
    {
      "name": "packages"
    },
    {
      "name": "product-groups"
    },
    {
      "name": "products"
    },
    {
      "name": "promo-codes"
    },
    {
      "name": "purchase-orders"
    },
    {
      "name": "refund-reasons"
    },
    {
      "name": "reviews"
    },
    {
      "name": "roles"
    },
    {
      "name": "sales"
    },
    {
      "name": "series"
    },
    {
      "name": "services"
    },
    {
      "name": "settings"
    },
    {
      "name": "staff"
    },
    {
      "name": "stock"
    },
    {
      "name": "suppliers"
    },
    {
      "name": "team"
    },
    {
      "name": "time-entries"
    },
    {
      "name": "waitlist"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings → API access."
      }
    },
    "responses": {
      "Error": {
        "description": "An error. `error.code` is machine-readable; `error.message` is for people.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/appointments": {
      "get": {
        "tags": [
          "appointments"
        ],
        "operationId": "getAppointments",
        "summary": "(from/to are ISO instants, matched on the start time)",
        "description": "(from/to are ISO instants, matched on the start time)",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "staff_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointments",
        "summary": "book one service for a client with one staff member.",
        "description": "book one service for a client with one staff member. 409 when the time is taken.",
        "x-scope": "appointments:book",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}": {
      "get": {
        "tags": [
          "appointments"
        ],
        "operationId": "getAppointmentsId",
        "summary": "GET /appointments/{id}",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "appointments"
        ],
        "operationId": "patchAppointmentsId",
        "summary": "change the status or the notes.",
        "description": "change the status or the notes.",
        "x-scope": "appointments:change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/cancel": {
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdCancel",
        "summary": "No fee is charged; refunds and fees stay in the staff app.",
        "description": "No fee is charged; refunds and fees stay in the staff app.",
        "x-scope": "appointments:cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/cancel-series": {
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdCancel-series",
        "summary": "{reason?, notify?}: cancel this visit and every later open visit of its standing appointment, and end the series.",
        "description": "{reason?, notify?}: cancel this visit and every later open visit of its standing appointment, and end the series. 409 when the visit is not part of a series. The client hears about the first cancelled visit (unless notify is false); no fee is charged.",
        "x-scope": "appointments:cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/items/{itemId}": {
      "delete": {
        "tags": [
          "appointments"
        ],
        "operationId": "deleteAppointmentsIdItemsItemId",
        "summary": "take one service off a visit (all of its segments).",
        "description": "take one service off a visit (all of its segments). The last service left cannot be taken off (409): cancel the visit with POST /appointments/:id/cancel instead, which records the reason and the late-cancel rules. A completed, no-show or cancelled visit cannot be changed (409).",
        "x-scope": "appointments:cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/items/{itemId}/move": {
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdItemsItemIdMove",
        "summary": "{start_at, staff_id?, notify?}: move one service of a visit (with its finishing segment), optionally to another provider.",
        "description": "{start_at, staff_id?, notify?}: move one service of a visit (with its finishing segment), optionally to another provider. 409 when the time is taken or outside their hours; class seats cannot be moved.",
        "x-scope": "appointments:change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/reschedule": {
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdReschedule",
        "summary": "{start_at, staff_id?, notify?}: moves the visit (its first service, which is the whole visit for a single-service booking); 409 when the time is taken or outside the provider's hours.",
        "description": "{start_at, staff_id?, notify?}: moves the visit (its first service, which is the whole visit for a single-service booking); 409 when the time is taken or outside the provider's hours.",
        "x-scope": "appointments:change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/services": {
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdServices",
        "summary": "{service_id, staff_id, start_at}: add another service to an existing visit.",
        "description": "{service_id, staff_id, start_at}: add another service to an existing visit. 409 when the time is taken or the visit can no longer change. No message is sent (the staff app does not send one either).",
        "x-scope": "appointments:change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/supplies": {
      "get": {
        "tags": [
          "appointments"
        ],
        "operationId": "getAppointmentsIdSupplies",
        "summary": "what has been logged as used on this visit (net of anything taken back).",
        "description": "what has been logged as used on this visit (net of anything taken back).",
        "x-scope": "inventory:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "appointments"
        ],
        "operationId": "postAppointmentsIdSupplies",
        "summary": "{ items: [{ product_id, quantity }], note? }.",
        "description": "{ items: [{ product_id, quantity }], note? }. Comes off the visit's location; may take a count below zero.",
        "x-scope": "supplies:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/appointments/{id}/supplies/{productId}": {
      "delete": {
        "tags": [
          "appointments"
        ],
        "operationId": "deleteAppointmentsIdSuppliesProductId",
        "summary": "take back supplies logged by mistake (default: everything logged for that product).",
        "description": "take back supplies logged by mistake (default: everything logged for that product).",
        "x-scope": "supplies:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/automations": {
      "get": {
        "tags": [
          "automations"
        ],
        "operationId": "getAutomations",
        "summary": "every automation (workflow), including the built-in ones, with how many messages each sent in the last 30 days.",
        "description": "every automation (workflow), including the built-in ones, with how many messages each sent in the last 30 days.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "automations"
        ],
        "operationId": "postAutomations",
        "summary": "create an automation.",
        "description": "create an automation. It starts off unless `enabled: true`.",
        "x-scope": "marketing:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/automations/{id}": {
      "get": {
        "tags": [
          "automations"
        ],
        "operationId": "getAutomationsId",
        "summary": "GET /automations/{id}",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "automations"
        ],
        "operationId": "patchAutomationsId",
        "summary": "change any of name, description, trigger, enabled, exit_on_booking, filters, steps.",
        "description": "change any of name, description, trigger, enabled, exit_on_booking, filters, steps. `filters` and `steps`, when given, replace the whole thing. Turning `enabled` off (alone or with other fields) cancels runs in flight, like the app's on/off switch.",
        "x-scope": "marketing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "automations"
        ],
        "operationId": "deleteAutomationsId",
        "summary": "delete a custom automation.",
        "description": "delete a custom automation. The built-in ones can only be turned off (409).",
        "x-scope": "marketing:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/automations/{id}/duplicate": {
      "post": {
        "tags": [
          "automations"
        ],
        "operationId": "postAutomationsIdDuplicate",
        "summary": "a copy named \"...",
        "description": "a copy named \"... (copy)\", switched off.",
        "x-scope": "marketing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/automations/{id}/runs": {
      "get": {
        "tags": [
          "automations"
        ],
        "operationId": "getAutomationsIdRuns",
        "summary": "who went through this automation, newest first, with each run's step log.",
        "description": "who went through this automation, newest first, with each run's step log.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/availability": {
      "get": {
        "tags": [
          "availability"
        ],
        "operationId": "getAvailability",
        "summary": "the open start times, as online booking would offer them.",
        "description": "the open start times, as online booking would offer them.",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "staff_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/blocks": {
      "post": {
        "tags": [
          "blocks"
        ],
        "operationId": "postBlocks",
        "summary": "take time off a provider's calendar (lunch, a training day, an outside appointment).",
        "description": "take time off a provider's calendar (lunch, a training day, an outside appointment). Up to 24 hours. 409 when it collides with a booking.",
        "x-scope": "appointments:change",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/blocks/{id}": {
      "delete": {
        "tags": [
          "blocks"
        ],
        "operationId": "deleteBlocksId",
        "summary": "remove blocked time.",
        "description": "remove blocked time. Only blocks: a client's appointment is never deleted through here (cancel it instead).",
        "x-scope": "appointments:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/business": {
      "get": {
        "tags": [
          "business"
        ],
        "operationId": "getBusiness",
        "summary": "the business this key belongs to.",
        "description": "the business this key belongs to.",
        "x-scope": "catalog:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/campaigns": {
      "get": {
        "tags": [
          "campaigns"
        ],
        "operationId": "getCampaigns",
        "summary": "campaigns, newest first.",
        "description": "campaigns, newest first.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "campaigns"
        ],
        "operationId": "postCampaigns",
        "summary": "create a draft.",
        "description": "create a draft. Nothing is sent until POST /campaigns/:id/send.",
        "x-scope": "marketing:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/campaigns/audience-preview": {
      "post": {
        "tags": [
          "campaigns"
        ],
        "operationId": "postCampaignsAudience-preview",
        "summary": "the same count for an audience you have not saved yet.",
        "description": "the same count for an audience you have not saved yet. Sends nothing.",
        "x-scope": "marketing:read",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/campaigns/{id}": {
      "get": {
        "tags": [
          "campaigns"
        ],
        "operationId": "getCampaignsId",
        "summary": "one campaign; once sent, with its delivery counts.",
        "description": "one campaign; once sent, with its delivery counts.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "campaigns"
        ],
        "operationId": "patchCampaignsId",
        "summary": "edit a draft.",
        "description": "edit a draft. A sent campaign cannot be edited (the app shows it read-only). `audience`, when given, replaces the whole audience.",
        "x-scope": "marketing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "campaigns"
        ],
        "operationId": "deleteCampaignsId",
        "summary": "delete a campaign (messages it already queued stay in the log, as in the app).",
        "description": "delete a campaign (messages it already queued stay in the log, as in the app).",
        "x-scope": "marketing:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/campaigns/{id}/audience": {
      "get": {
        "tags": [
          "campaigns"
        ],
        "operationId": "getCampaignsIdAudience",
        "summary": "how many clients the campaign would reach right now on its channel, with a few example names.",
        "description": "how many clients the campaign would reach right now on its channel, with a few example names.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/campaigns/{id}/send": {
      "post": {
        "tags": [
          "campaigns"
        ],
        "operationId": "postCampaignsIdSend",
        "summary": "queue the campaign to everyone its audience matches (the same function the app's Send button calls).",
        "description": "queue the campaign to everyone its audience matches (the same function the app's Send button calls). A campaign can be sent once: a second call, or one made while the first is still running, answers 409.",
        "x-scope": "campaigns:send",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/categories": {
      "get": {
        "tags": [
          "categories"
        ],
        "operationId": "getCategories",
        "summary": "(default service).",
        "description": "(default service). Service categories nest through parent_id.",
        "x-scope": "catalog:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "categories"
        ],
        "operationId": "postCategories",
        "summary": "{ kind, name, parent_id?, description?, prep_notes? }.",
        "description": "{ kind, name, parent_id?, description?, prep_notes? }. Product categories are flat and only have a name.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/categories/{id}": {
      "get": {
        "tags": [
          "categories"
        ],
        "operationId": "getCategoriesId",
        "summary": "(default service).",
        "description": "(default service).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "categories"
        ],
        "operationId": "patchCategoriesId",
        "summary": "send only what changes.",
        "description": "send only what changes. A service category may move under another with parent_id (never inside itself: 409).",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "categories"
        ],
        "operationId": "deleteCategoriesId",
        "summary": "its items become uncategorised and its sub-categories move up a level.",
        "description": "its items become uncategorised and its sub-categories move up a level.",
        "x-scope": "catalog:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/categories/{id}/move": {
      "post": {
        "tags": [
          "categories"
        ],
        "operationId": "postCategoriesIdMove",
        "summary": "{ direction: \"up\" | \"down\" } one step among its siblings.",
        "description": "{ direction: \"up\" | \"down\" } one step among its siblings. Returns the renumbered list.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/classes": {
      "get": {
        "tags": [
          "classes"
        ],
        "operationId": "getClasses",
        "summary": "scheduled class sessions with seats booked and left.",
        "description": "scheduled class sessions with seats booked and left. Defaults to the next 60 days; a window is at most a year.",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_cancelled",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "classes"
        ],
        "operationId": "postClasses",
        "summary": "{service_id, staff_id, start_at, capacity?, notes?}: schedule a class session.",
        "description": "{service_id, staff_id, start_at, capacity?, notes?}: schedule a class session. The service must have a group size above 1; 409 when the instructor is not free then.",
        "x-scope": "classes:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/classes/{id}": {
      "get": {
        "tags": [
          "classes"
        ],
        "operationId": "getClassesId",
        "summary": "one session with its roster (who holds a seat and the status of their booking; no contact details).",
        "description": "one session with its roster (who holds a seat and the status of their booking; no contact details).",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/classes/{id}/cancel": {
      "post": {
        "tags": [
          "classes"
        ],
        "operationId": "postClassesIdCancel",
        "summary": "{reason?, notify?}: cancel the session and every open seat in it.",
        "description": "{reason?, notify?}: cancel the session and every open seat in it. With notify (default true) each client is told. No refunds are made.",
        "x-scope": "classes:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/classes/{id}/enrollments": {
      "post": {
        "tags": [
          "classes"
        ],
        "operationId": "postClassesIdEnrollments",
        "summary": "{client_id, notes?, notify?}: give a client a seat (client_id may be null for a walk-in).",
        "description": "{client_id, notes?, notify?}: give a client a seat (client_id may be null for a walk-in). 409 when the class is full, has started, is cancelled or the client already has a seat. Returns the class; the new booking is the roster row with the highest booked_at.",
        "x-scope": "classes:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClients",
        "summary": "GET /clients",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "clients"
        ],
        "operationId": "postClients",
        "summary": "A client with the same email or phone already on file is a 409 that names the existing id.",
        "description": "A client with the same email or phone already on file is a 409 that names the existing id.",
        "x-scope": "clients:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsId",
        "summary": "GET /clients/{id}",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "clients"
        ],
        "operationId": "patchClientsId",
        "summary": "send only the fields to change.",
        "description": "send only the fields to change.",
        "x-scope": "clients:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/appointments": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdAppointments",
        "summary": "this client's visits (not blocked time), earliest first.",
        "description": "this client's visits (not blocked time), earliest first. Same shape as GET /appointments.",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/memberships": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdMemberships",
        "summary": "what this client currently holds.",
        "description": "what this client currently holds.",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/messages": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdMessages",
        "summary": "the text conversation with one client (their replies and what was texted to them), oldest first.",
        "description": "the text conversation with one client (their replies and what was texted to them), oldest first.",
        "x-scope": "messages:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "clients"
        ],
        "operationId": "postClientsIdMessages",
        "summary": "text the client (the staff reply from the client page).",
        "description": "text the client (the staff reply from the client page). The text is queued like every other message. A client with no mobile number, or who opted out of texts (STOP), answers 409 with the app's message and nothing is queued.",
        "x-scope": "messages:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/notes": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdNotes",
        "summary": "GET /clients/{id}/notes",
        "x-scope": "client-notes:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "clients"
        ],
        "operationId": "postClientsIdNotes",
        "summary": "add a private note (formula, allergy, preference).",
        "description": "add a private note (formula, allergy, preference).",
        "x-scope": "client-notes:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/notes/{noteId}": {
      "patch": {
        "tags": [
          "clients"
        ],
        "operationId": "patchClientsIdNotesNoteId",
        "summary": "{pinned}: pin or unpin a note (the same as the pin button in the staff app).",
        "description": "{pinned}: pin or unpin a note (the same as the pin button in the staff app).",
        "x-scope": "client-notes:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "clients"
        ],
        "operationId": "deleteClientsIdNotesNoteId",
        "summary": "notes are deleted outright in the staff app too.",
        "description": "notes are deleted outright in the staff app too.",
        "x-scope": "client-notes:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/packages": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdPackages",
        "summary": "what this client currently holds.",
        "description": "what this client currently holds.",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/referral-code": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdReferral-code",
        "summary": "the client's code, or null when none has been made yet.",
        "description": "the client's code, or null when none has been made yet.",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "clients"
        ],
        "operationId": "postClientsIdReferral-code",
        "summary": "make the client's referral code (returns the existing one if they already have it).",
        "description": "make the client's referral code (returns the existing one if they already have it). Nothing is sent to the client.",
        "x-scope": "clients:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/clients/{id}/submissions": {
      "get": {
        "tags": [
          "clients"
        ],
        "operationId": "getClientsIdSubmissions",
        "summary": "the forms this client has filled in, newest first (a summary: read the answers with GET /form-submissions/:id).",
        "description": "the forms this client has filled in, newest first (a summary: read the answers with GET /form-submissions/:id).",
        "x-scope": "clients:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/form-submissions": {
      "get": {
        "tags": [
          "form-submissions"
        ],
        "operationId": "getForm-submissions",
        "summary": "what clients submitted, newest first (a summary; the answers are on GET /form-submissions/:id).",
        "description": "what clients submitted, newest first (a summary; the answers are on GET /form-submissions/:id).",
        "x-scope": "forms:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "form_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_voided",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/form-submissions/{id}": {
      "get": {
        "tags": [
          "form-submissions"
        ],
        "operationId": "getForm-submissionsId",
        "summary": "one submission with each question, its label and the answer.",
        "description": "one submission with each question, its label and the answer. Uploaded files and the drawn signature are not returned.",
        "x-scope": "forms:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/form-submissions/{id}/reassign": {
      "post": {
        "tags": [
          "form-submissions"
        ],
        "operationId": "postForm-submissionsIdReassign",
        "summary": "{client_id}: move a submission filed under the wrong person to the right client (it is detached from any visit).",
        "description": "{client_id}: move a submission filed under the wrong person to the right client (it is detached from any visit).",
        "x-scope": "forms:void",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/form-submissions/{id}/void": {
      "post": {
        "tags": [
          "form-submissions"
        ],
        "operationId": "postForm-submissionsIdVoid",
        "summary": "{reason?}: it stays on file, struck through, and no longer counts as signed.",
        "description": "{reason?}: it stays on file, struck through, and no longer counts as signed. 409 when already void.",
        "x-scope": "forms:void",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/forms": {
      "get": {
        "tags": [
          "forms"
        ],
        "operationId": "getForms",
        "summary": "your intake and consent forms, live ones first (with a field_count; GET /forms/:id has the questions).",
        "description": "your intake and consent forms, live ones first (with a field_count; GET /forms/:id has the questions).",
        "x-scope": "forms:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "forms"
        ],
        "operationId": "postForms",
        "summary": "create a form.",
        "description": "create a form. Required: name, kind (intake or consent). Needs at least one question or some description text. Questions are checked with the form builder's rules (see the docs). service_ids and location_ids must be yours; naming none or every location means everywhere.",
        "x-scope": "forms:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/forms/{id}": {
      "get": {
        "tags": [
          "forms"
        ],
        "operationId": "getFormsId",
        "summary": "GET /forms/{id}",
        "x-scope": "forms:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "forms"
        ],
        "operationId": "patchFormsId",
        "summary": "send only what changes.",
        "description": "send only what changes. Sending `fields` replaces the whole list of questions (keep a question's id to keep its meaning in old submissions).",
        "x-scope": "forms:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "forms"
        ],
        "operationId": "deleteFormsId",
        "summary": "like the staff app, a form that clients have already submitted is archived (active=false) so the signed copies stay; one nobody has submitted is deleted.",
        "description": "like the staff app, a form that clients have already submitted is archived (active=false) so the signed copies stay; one nobody has submitted is deleted. The response says which (`deleted` or `archived`).",
        "x-scope": "forms:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/forms/{id}/duplicate": {
      "post": {
        "tags": [
          "forms"
        ],
        "operationId": "postFormsIdDuplicate",
        "summary": "a copy named \"Copy of ...\", inactive until you turn it on.",
        "description": "a copy named \"Copy of ...\", inactive until you turn it on.",
        "x-scope": "forms:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/inventory": {
      "get": {
        "tags": [
          "inventory"
        ],
        "operationId": "getInventory",
        "summary": "products whose stock is tracked, with the count on hand and whether it is at or under the low-stock level.",
        "description": "products whose stock is tracked, with the count on hand and whether it is at or under the low-stock level. Also the inventory settings an inventory key may see: cost, usual supplier, order-up-to level, and the option label and group of a product that comes in options.",
        "x-scope": "inventory:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/inventory/reorder-suggestions": {
      "get": {
        "tags": [
          "inventory"
        ],
        "operationId": "getInventoryReorder-suggestions",
        "summary": "what to order, grouped by supplier and location.",
        "description": "what to order, grouped by supplier and location. Each location's shortfall is its own order; what is already on its way counts as stock. Turn a group into a draft with POST /purchase-orders.",
        "x-scope": "inventory:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/locations": {
      "get": {
        "tags": [
          "locations"
        ],
        "operationId": "getLocations",
        "summary": "addresses, hours and phone.",
        "description": "addresses, hours and phone. Payment accounts and tokens are not included.",
        "x-scope": "catalog:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "locations"
        ],
        "operationId": "postLocations",
        "summary": "add a location.",
        "description": "add a location.",
        "x-scope": "settings:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/locations/{id}": {
      "get": {
        "tags": [
          "locations"
        ],
        "operationId": "getLocationsId",
        "summary": "GET /locations/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "locations"
        ],
        "operationId": "patchLocationsId",
        "summary": "PATCH /locations/{id}",
        "x-scope": "settings:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "locations"
        ],
        "operationId": "deleteLocationsId",
        "summary": "DELETE /locations/{id}",
        "x-scope": "settings:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/locations/{id}/default": {
      "post": {
        "tags": [
          "locations"
        ],
        "operationId": "postLocationsIdDefault",
        "summary": "make this the default location.",
        "description": "make this the default location.",
        "x-scope": "settings:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/membership-plans": {
      "get": {
        "tags": [
          "membership-plans"
        ],
        "operationId": "getMembership-plans",
        "summary": "the membership plans you sell (hidden ones only with include_inactive).",
        "description": "the membership plans you sell (hidden ones only with include_inactive).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "membership-plans"
        ],
        "operationId": "postMembership-plans",
        "summary": "Configures a plan; enrolling a client (which bills them) happens at checkout, not here.",
        "description": "Configures a plan; enrolling a client (which bills them) happens at checkout, not here.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/membership-plans/{id}": {
      "get": {
        "tags": [
          "membership-plans"
        ],
        "operationId": "getMembership-plansId",
        "summary": "GET /membership-plans/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "membership-plans"
        ],
        "operationId": "patchMembership-plansId",
        "summary": "send only what changes; the cadence must be billable (422 otherwise).",
        "description": "send only what changes; the cadence must be billable (422 otherwise). services replaces the covered services, and current members' visits follow as in the app. A new price or cadence clears the stored Stripe price, as in the app. {\"active\": false} hides the plan.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/messages": {
      "get": {
        "tags": [
          "messages"
        ],
        "operationId": "getMessages",
        "summary": "texts clients sent to the business's number, newest first.",
        "description": "texts clients sent to the business's number, newest first.",
        "x-scope": "messages:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unread",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/notifications": {
      "get": {
        "tags": [
          "notifications"
        ],
        "operationId": "getNotifications",
        "summary": "the delivery log of texts and emails sent to clients, newest first.",
        "description": "the delivery log of texts and emails sent to clients, newest first. Filters: channel, status, client_id, campaign_id, template, from, to (ISO times, on the created time).",
        "x-scope": "messages:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/notifications/{id}": {
      "get": {
        "tags": [
          "notifications"
        ],
        "operationId": "getNotificationsId",
        "summary": "GET /notifications/{id}",
        "x-scope": "messages:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/notifications/{id}/resend": {
      "post": {
        "tags": [
          "notifications"
        ],
        "operationId": "postNotificationsIdResend",
        "summary": "try a failed or skipped message again, now (the app's \"Resend\" button).",
        "description": "try a failed or skipped message again, now (the app's \"Resend\" button). Anything else answers 409. The result says how the attempt went; the message is returned with its new status.",
        "x-scope": "messages:resend",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/packages": {
      "get": {
        "tags": [
          "packages"
        ],
        "operationId": "getPackages",
        "summary": "the prepaid session packages you sell (hidden ones only with include_inactive).",
        "description": "the prepaid session packages you sell (hidden ones only with include_inactive).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "packages"
        ],
        "operationId": "postPackages",
        "summary": "Configures what you sell; selling one to a client happens at checkout, not here.",
        "description": "Configures what you sell; selling one to a client happens at checkout, not here.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/packages/{id}": {
      "get": {
        "tags": [
          "packages"
        ],
        "operationId": "getPackagesId",
        "summary": "GET /packages/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "packages"
        ],
        "operationId": "patchPackagesId",
        "summary": "send only what changes.",
        "description": "send only what changes. {\"active\": false} hides it from sale; true shows it again.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/product-groups": {
      "get": {
        "tags": [
          "product-groups"
        ],
        "operationId": "getProduct-groups",
        "summary": "products that come in options (sizes, shades), each with its options.",
        "description": "products that come in options (sizes, shades), each with its options.",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "product-groups"
        ],
        "operationId": "postProduct-groups",
        "summary": "{ name, options: [\"50 ml\", \"100 ml\"], price_cents, ...",
        "description": "{ name, options: [\"50 ml\", \"100 ml\"], price_cents, ... }. Makes the group and one product per option.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/product-groups/{id}": {
      "get": {
        "tags": [
          "product-groups"
        ],
        "operationId": "getProduct-groupsId",
        "summary": "GET /product-groups/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "product-groups"
        ],
        "operationId": "patchProduct-groupsId",
        "summary": "what the options share (every option follows).",
        "description": "what the options share (every option follows). {\"active\": false} hides the product with all its options.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/product-groups/{id}/options": {
      "post": {
        "tags": [
          "product-groups"
        ],
        "operationId": "postProduct-groupsIdOptions",
        "summary": "{ options: [...], price_cents?, cost_cents? }.",
        "description": "{ options: [...], price_cents?, cost_cents? }. Labels the group already has are skipped (409 when none is new).",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products": {
      "get": {
        "tags": [
          "products"
        ],
        "operationId": "getProducts",
        "summary": "active products.",
        "description": "active products. Cost, supplier and reorder settings are not exposed (see /inventory for those).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "products"
        ],
        "operationId": "postProducts",
        "summary": "A barcode or SKU can belong to one product only (409 otherwise).",
        "description": "A barcode or SKU can belong to one product only (409 otherwise). Products that come in options use /product-groups.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "products"
        ],
        "operationId": "getProductsId",
        "summary": "GET /products/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "products"
        ],
        "operationId": "patchProductsId",
        "summary": "Stock counts are changed through /stock-adjustments, never here.",
        "description": "Stock counts are changed through /stock-adjustments, never here. Set active=false to retire a product. An option of a product (it has a group) keeps what the group shares (name, category, kind, tax, online store, supplier) in step with the group: those are changed with PATCH /product-groups/:id and are refused here (409).",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/barcodes": {
      "get": {
        "tags": [
          "products"
        ],
        "operationId": "getProductsIdBarcodes",
        "summary": "the extra barcodes (a case, another pack size).",
        "description": "the extra barcodes (a case, another pack size). The main barcode is on the product itself.",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "products"
        ],
        "operationId": "postProductsIdBarcodes",
        "summary": "{ code, units_per_scan? }.",
        "description": "{ code, units_per_scan? }. A code can belong to one product only (409).",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/barcodes/{barcodeId}": {
      "delete": {
        "tags": [
          "products"
        ],
        "operationId": "deleteProductsIdBarcodesBarcodeId",
        "summary": "remove an extra barcode.",
        "description": "remove an extra barcode.",
        "x-scope": "catalog:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "barcodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/convert-to-group": {
      "post": {
        "tags": [
          "products"
        ],
        "operationId": "postProductsIdConvert-to-group",
        "summary": "{ label }.",
        "description": "{ label }. The product becomes the first option of a new group, so more options can be added to it.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/stock": {
      "get": {
        "tags": [
          "products"
        ],
        "operationId": "getProductsIdStock",
        "summary": "what is on hand in total and at each location.",
        "description": "what is on hand in total and at each location.",
        "x-scope": "inventory:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/stock-adjustments": {
      "post": {
        "tags": [
          "products"
        ],
        "operationId": "postProductsIdStock-adjustments",
        "summary": "record a stock change.",
        "description": "record a stock change. It never goes below zero (409).",
        "x-scope": "inventory:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/products/{id}/stock-movements": {
      "get": {
        "tags": [
          "products"
        ],
        "operationId": "getProductsIdStock-movements",
        "summary": "every change to this product's stock, newest first.",
        "description": "every change to this product's stock, newest first.",
        "x-scope": "inventory:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/promo-codes": {
      "get": {
        "tags": [
          "promo-codes"
        ],
        "operationId": "getPromo-codes",
        "summary": "promo codes, active ones first.",
        "description": "promo codes, active ones first.",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "active",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "promo-codes"
        ],
        "operationId": "postPromo-codes",
        "summary": "create a code (the app's rules: letters/digits/dashes only, percent 1-100 or an amount in cents, unique per business).",
        "description": "create a code (the app's rules: letters/digits/dashes only, percent 1-100 or an amount in cents, unique per business).",
        "x-scope": "marketing:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/promo-codes/{id}": {
      "get": {
        "tags": [
          "promo-codes"
        ],
        "operationId": "getPromo-codesId",
        "summary": "GET /promo-codes/{id}",
        "x-scope": "marketing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "promo-codes"
        ],
        "operationId": "patchPromo-codesId",
        "summary": "turn a code on or off.",
        "description": "turn a code on or off. That is all the app lets you change; create a new code for anything else.",
        "x-scope": "marketing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders": {
      "get": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "getPurchase-orders",
        "summary": "(default open: draft, ordered and partly received; received covers cancelled too).",
        "description": "(default open: draft, ordered and partly received; received covers cancelled too).",
        "x-scope": "purchasing:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "postPurchase-orders",
        "summary": "a draft order.",
        "description": "a draft order. { supplier_id?, location_id?, expected_on?, notes?, lines?: [{ product_id, quantity, unit_cost_cents? }] }.",
        "x-scope": "purchasing:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}": {
      "get": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "getPurchase-ordersId",
        "summary": "the order with its lines and what has been received against it.",
        "description": "the order with its lines and what has been received against it.",
        "x-scope": "purchasing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "patchPurchase-ordersId",
        "summary": "supplier, location, expected_on, reference, notes.",
        "description": "supplier, location, expected_on, reference, notes. Only while the order is open (409 once received or cancelled).",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}/cancel": {
      "post": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "postPurchase-ordersIdCancel",
        "summary": "cancel an order that is still open (409 otherwise).",
        "description": "cancel an order that is still open (409 otherwise).",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}/lines": {
      "post": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "postPurchase-ordersIdLines",
        "summary": "{ product_id, quantity, unit_cost_cents? }.",
        "description": "{ product_id, quantity, unit_cost_cents? }. Adds the product, or replaces its quantity if it is already on the order.",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}/lines/{productId}": {
      "patch": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "patchPurchase-ordersIdLinesProductId",
        "summary": "{ quantity?, unit_cost_cents? } on a line that is already on the order.",
        "description": "{ quantity?, unit_cost_cents? } on a line that is already on the order.",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "deletePurchase-ordersIdLinesProductId",
        "summary": "remove a line (409 once some of it has arrived).",
        "description": "remove a line (409 once some of it has arrived).",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}/order": {
      "post": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "postPurchase-ordersIdOrder",
        "summary": "mark a draft as ordered (it needs at least one line).",
        "description": "mark a draft as ordered (it needs at least one line). This records that you ordered; it does not contact the supplier.",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/purchase-orders/{id}/receive": {
      "post": {
        "tags": [
          "purchase-orders"
        ],
        "operationId": "postPurchase-ordersIdReceive",
        "summary": "{ reference?, lines: [{ line_id, quantity, unit_cost_cents? }] }.",
        "description": "{ reference?, lines: [{ line_id, quantity, unit_cost_cents? }] }. Adds the stock; the order completes when everything has arrived.",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/refund-reasons": {
      "get": {
        "tags": [
          "refund-reasons"
        ],
        "operationId": "getRefund-reasons",
        "summary": "GET /refund-reasons",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "refund-reasons"
        ],
        "operationId": "postRefund-reasons",
        "summary": "POST /refund-reasons",
        "x-scope": "settings:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/refund-reasons/{id}": {
      "patch": {
        "tags": [
          "refund-reasons"
        ],
        "operationId": "patchRefund-reasonsId",
        "summary": "rename, retire (active: false) or restore.",
        "description": "rename, retire (active: false) or restore.",
        "x-scope": "settings:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/refund-reasons/{id}/move": {
      "post": {
        "tags": [
          "refund-reasons"
        ],
        "operationId": "postRefund-reasonsIdMove",
        "summary": "swap places with the neighbour above or below.",
        "description": "swap places with the neighbour above or below.",
        "x-scope": "settings:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/reviews": {
      "get": {
        "tags": [
          "reviews"
        ],
        "operationId": "getReviews",
        "summary": "submitted reviews, newest first.",
        "description": "submitted reviews, newest first.",
        "x-scope": "reviews:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "rating",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "staff_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/roles": {
      "get": {
        "tags": [
          "roles"
        ],
        "operationId": "getRoles",
        "summary": "GET /roles",
        "x-scope": "roles:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "roles"
        ],
        "operationId": "postRoles",
        "summary": "POST /roles",
        "x-scope": "roles:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/roles/permissions": {
      "get": {
        "tags": [
          "roles"
        ],
        "operationId": "getRolesPermissions",
        "summary": "every permission a role can hold, grouped as in the role editor.",
        "description": "every permission a role can hold, grouped as in the role editor.",
        "x-scope": "roles:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/roles/{id}": {
      "get": {
        "tags": [
          "roles"
        ],
        "operationId": "getRolesId",
        "summary": "GET /roles/{id}",
        "x-scope": "roles:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "roles"
        ],
        "operationId": "patchRolesId",
        "summary": "PATCH /roles/{id}",
        "x-scope": "roles:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "roles"
        ],
        "operationId": "deleteRolesId",
        "summary": "DELETE /roles/{id}",
        "x-scope": "roles:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/sales": {
      "get": {
        "tags": [
          "sales"
        ],
        "operationId": "getSales",
        "summary": "GET /sales",
        "x-scope": "sales:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/sales/{id}": {
      "get": {
        "tags": [
          "sales"
        ],
        "operationId": "getSalesId",
        "summary": "GET /sales/{id}",
        "x-scope": "sales:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/series": {
      "post": {
        "tags": [
          "series"
        ],
        "operationId": "postSeries",
        "summary": "book a standing appointment (\"every N weeks, M visits\").",
        "description": "book a standing appointment (\"every N weeks, M visits\"). Dates that are outside the provider's hours or already taken are skipped and reported in `skipped`; 409 when none of the dates work. With notify (default true) the client gets one confirmation for the first visit and reminders are scheduled for the rest, as in the staff app.",
        "x-scope": "appointments:book",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/series/{id}": {
      "get": {
        "tags": [
          "series"
        ],
        "operationId": "getSeriesId",
        "summary": "a standing appointment and every visit booked from it, in date order.",
        "description": "a standing appointment and every visit booked from it, in date order.",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/services": {
      "get": {
        "tags": [
          "services"
        ],
        "operationId": "getServices",
        "summary": "GET /services",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "services"
        ],
        "operationId": "postServices",
        "summary": "Prices are in cents.",
        "description": "Prices are in cents.",
        "x-scope": "catalog:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/services/{id}": {
      "get": {
        "tags": [
          "services"
        ],
        "operationId": "getServicesId",
        "summary": "GET /services/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "services"
        ],
        "operationId": "patchServicesId",
        "summary": "send only what changes.",
        "description": "send only what changes. Set active=false to retire a service (services are never deleted: history keeps pointing at them).",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/services/{id}/move": {
      "post": {
        "tags": [
          "services"
        ],
        "operationId": "postServicesIdMove",
        "summary": "{ direction: \"up\" | \"down\" } one step within its category.",
        "description": "{ direction: \"up\" | \"down\" } one step within its category.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/services/{id}/staff": {
      "get": {
        "tags": [
          "services"
        ],
        "operationId": "getServicesIdStaff",
        "summary": "who performs the service, with the price and length each charges (their own, or the service's).",
        "description": "who performs the service, with the price and length each charges (their own, or the service's).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "put": {
        "tags": [
          "services"
        ],
        "operationId": "putServicesIdStaff",
        "summary": "replace the set of people who perform it.",
        "description": "replace the set of people who perform it. Omit a price or length to keep what is stored; null uses the service's own.",
        "x-scope": "catalog:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/booking": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsBooking",
        "summary": "GET /settings/booking",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsBooking",
        "summary": "PATCH /settings/booking",
        "x-scope": "policies:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/loyalty": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsLoyalty",
        "summary": "GET /settings/loyalty",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsLoyalty",
        "summary": "PATCH /settings/loyalty",
        "x-scope": "policies:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/notifications": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsNotifications",
        "summary": "GET /settings/notifications",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsNotifications",
        "summary": "PATCH /settings/notifications",
        "x-scope": "settings:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/profile": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsProfile",
        "summary": "GET /settings/profile",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsProfile",
        "summary": "PATCH /settings/profile",
        "x-scope": "settings:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/reviews": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsReviews",
        "summary": "GET /settings/reviews",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsReviews",
        "summary": "PATCH /settings/reviews",
        "x-scope": "settings:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/settings/store": {
      "get": {
        "tags": [
          "settings"
        ],
        "operationId": "getSettingsStore",
        "summary": "GET /settings/store",
        "x-scope": "settings:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "settings"
        ],
        "operationId": "patchSettingsStore",
        "summary": "PATCH /settings/store",
        "x-scope": "policies:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaff",
        "summary": "active team members (public profile fields only).",
        "description": "active team members (public profile fields only).",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "staff"
        ],
        "operationId": "postStaff",
        "summary": "add a team member (starts with Tue-Sat 9 to 5, like the app).",
        "description": "add a team member (starts with Tue-Sat 9 to 5, like the app).",
        "x-scope": "staff:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaffId",
        "summary": "GET /staff/{id}",
        "x-scope": "catalog:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "staff"
        ],
        "operationId": "patchStaffId",
        "summary": "profile fields, active or inactive, whether they take appointments or show online, primary location, sort order.",
        "description": "profile fields, active or inactive, whether they take appointments or show online, primary location, sort order.",
        "x-scope": "staff:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}/overrides": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaffIdOverrides",
        "summary": "days off and changed hours from today (or ?from) on, with ids.",
        "description": "days off and changed hours from today (or ?from) on, with ids.",
        "x-scope": "staff:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "staff"
        ],
        "operationId": "postStaffIdOverrides",
        "summary": "a day off or changed hours for one date or a range.",
        "description": "a day off or changed hours for one date or a range.",
        "x-scope": "staff:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}/overrides/{overrideId}": {
      "delete": {
        "tags": [
          "staff"
        ],
        "operationId": "deleteStaffIdOverridesOverrideId",
        "summary": "DELETE /staff/{id}/overrides/{overrideId}",
        "x-scope": "staff:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "overrideId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}/pay": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaffIdPay",
        "summary": "GET /staff/{id}/pay",
        "x-scope": "pay:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "put": {
        "tags": [
          "staff"
        ],
        "operationId": "putStaffIdPay",
        "summary": "record a pay change effective from a date (default today).",
        "description": "record a pay change effective from a date (default today).",
        "x-scope": "pay:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}/schedule": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaffIdSchedule",
        "summary": "weekly hours (24h local time), upcoming days off or changed hours, and the services they perform with any own price or length.",
        "description": "weekly hours (24h local time), upcoming days off or changed hours, and the services they perform with any own price or length. A person's hours are team data (S5 in PERMISSIONS-PLAN-2026-10-18.md), so this reads with staff:read (it was catalog:read).",
        "x-scope": "staff:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "put": {
        "tags": [
          "staff"
        ],
        "operationId": "putStaffIdSchedule",
        "summary": "replace the weekly hours (and rotation).",
        "description": "replace the weekly hours (and rotation).",
        "x-scope": "staff:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/staff/{id}/services": {
      "get": {
        "tags": [
          "staff"
        ],
        "operationId": "getStaffIdServices",
        "summary": "GET /staff/{id}/services",
        "x-scope": "staff:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "put": {
        "tags": [
          "staff"
        ],
        "operationId": "putStaffIdServices",
        "summary": "replace which services they perform, with their own price and length where they differ.",
        "description": "replace which services they perform, with their own price and length where they differ.",
        "x-scope": "staff:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/counts": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockCounts",
        "summary": "{ location_id, note?, counts: [{ product_id, counted }] }.",
        "description": "{ location_id, note?, counts: [{ product_id, counted }] }. Products you leave out are not touched.",
        "x-scope": "inventory:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/receipts": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockReceipts",
        "summary": "a delivery with no purchase order.",
        "description": "a delivery with no purchase order. { location_id?, note?, items: [{ product_id, quantity }] }, one product or many.",
        "x-scope": "inventory:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/receipts/{id}/undo": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockReceiptsIdUndo",
        "summary": "take back a delivery entered wrong (:id is the stock movement's id).",
        "description": "take back a delivery entered wrong (:id is the stock movement's id). 409 when some of it has already gone.",
        "x-scope": "inventory:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/transfers": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockTransfers",
        "summary": "{ product_id, from_location_id, to_location_id, quantity, note? }.",
        "description": "{ product_id, from_location_id, to_location_id, quantity, note? }. The source cannot go below zero (409).",
        "x-scope": "inventory:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/usage": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockUsage",
        "summary": "log supplies used up, not tied to a visit.",
        "description": "log supplies used up, not tied to a visit. { location_id?, note?, items: [{ product_id, quantity }] }. May take a count below zero.",
        "x-scope": "inventory:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/stock/usage/{id}/undo": {
      "post": {
        "tags": [
          "stock"
        ],
        "operationId": "postStockUsageIdUndo",
        "summary": "take back a use logged by mistake (:id is the stock movement's id).",
        "description": "take back a use logged by mistake (:id is the stock movement's id). Once only; a use logged on a visit is taken back on that visit.",
        "x-scope": "inventory:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/suppliers": {
      "get": {
        "tags": [
          "suppliers"
        ],
        "operationId": "getSuppliers",
        "summary": "GET /suppliers",
        "x-scope": "purchasing:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "suppliers"
        ],
        "operationId": "postSuppliers",
        "summary": "{ name, contact_name?, email?, phone?, account_number?, notes? }.",
        "description": "{ name, contact_name?, email?, phone?, account_number?, notes? }.",
        "x-scope": "purchasing:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/suppliers/{id}": {
      "get": {
        "tags": [
          "suppliers"
        ],
        "operationId": "getSuppliersId",
        "summary": "GET /suppliers/{id}",
        "x-scope": "purchasing:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "suppliers"
        ],
        "operationId": "patchSuppliersId",
        "summary": "send only what changes.",
        "description": "send only what changes. {\"active\": false} hides the supplier (suppliers are never deleted: orders point at them).",
        "x-scope": "purchasing:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/team": {
      "get": {
        "tags": [
          "team"
        ],
        "operationId": "getTeam",
        "summary": "every team member, inactive ones included, with contact details.",
        "description": "every team member, inactive ones included, with contact details. Pay, PINs, calendar tokens and logins are never included.",
        "x-scope": "staff:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/team/{id}": {
      "get": {
        "tags": [
          "team"
        ],
        "operationId": "getTeamId",
        "summary": "GET /team/{id}",
        "x-scope": "staff:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/time-entries": {
      "get": {
        "tags": [
          "time-entries"
        ],
        "operationId": "getTime-entries",
        "summary": "GET /time-entries",
        "x-scope": "time:read",
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "time-entries"
        ],
        "operationId": "postTime-entries",
        "summary": "POST /time-entries",
        "x-scope": "time:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/time-entries/{id}": {
      "delete": {
        "tags": [
          "time-entries"
        ],
        "operationId": "deleteTime-entriesId",
        "summary": "DELETE /time-entries/{id}",
        "x-scope": "time:delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/waitlist": {
      "get": {
        "tags": [
          "waitlist"
        ],
        "operationId": "getWaitlist",
        "summary": "GET /waitlist",
        "x-scope": "appointments:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "waitlist"
        ],
        "operationId": "postWaitlist",
        "summary": "put a client on the waitlist for a date.",
        "description": "put a client on the waitlist for a date.",
        "x-scope": "waitlist:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/waitlist/{id}": {
      "patch": {
        "tags": [
          "waitlist"
        ],
        "operationId": "patchWaitlistId",
        "summary": "{status}",
        "description": "{status}",
        "x-scope": "waitlist:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The body is `{ data }` (a list adds `page`, `limit` and `has_more`, and `total` where counted), or the bare object for single results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  }
}
