{
  "openapi": "3.1.0",
  "info": {
    "title": "Open Pizza core API",
    "version": "0.3.0",
    "description": "The /v1 module contract. Tenant is always derived from the token (`tid`). Additive changes only within v1; clients must tolerate unknown fields and enum values. Generated from @openpizza/core zod schemas — do not edit by hand.",
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "tags": [
    {
      "name": "Tenant"
    },
    {
      "name": "Locations"
    },
    {
      "name": "Menu"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Payments"
    },
    {
      "name": "Customers"
    },
    {
      "name": "Staff"
    },
    {
      "name": "Deliveries"
    },
    {
      "name": "Sales"
    },
    {
      "name": "Events"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Directory"
    },
    {
      "name": "Devices"
    },
    {
      "name": "Realtime"
    },
    {
      "name": "Notifications"
    },
    {
      "name": "Providers"
    },
    {
      "name": "Auth"
    }
  ],
  "paths": {
    "/v1/tenant": {
      "get": {
        "operationId": "tenant.get",
        "summary": "The calling tenant",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "openpizza": [
              "tenant:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "tenant:read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/capabilities": {
      "get": {
        "operationId": "capabilities.get",
        "summary": "What the tenant's commerce source supports",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "openpizza": []
          }
        ],
        "x-openpizza-served-by": "hub",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/entitlements": {
      "get": {
        "operationId": "entitlements.get",
        "summary": "Module entitlements (core.tenant_modules) + POS plan",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "openpizza": [
              "entitlements:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "entitlements:read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entitlements"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations": {
      "get": {
        "operationId": "locations.list",
        "summary": "List locations",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "openpizza": [
              "locations:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "locations:read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}": {
      "get": {
        "operationId": "locations.get",
        "summary": "Get a location",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "openpizza": [
              "locations:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "locations:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/menu": {
      "get": {
        "operationId": "menu.get",
        "summary": "Resolved menu for a location (overrides + 86 folded in)",
        "tags": [
          "Menu"
        ],
        "security": [
          {
            "openpizza": [
              "menu:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "menu:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Menu"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/menu/availability": {
      "put": {
        "operationId": "menu.setAvailability",
        "summary": "86 / un-86 an item, size or modifier",
        "tags": [
          "Menu"
        ],
        "security": [
          {
            "openpizza": [
              "menu.availability:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "menu.availability:write"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuSetAvailabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuSetAvailabilityResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes": {
      "post": {
        "operationId": "quotes.create",
        "summary": "Server-priced quote (priceCart)",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "quotes:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "quotes:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes/{quote_id}": {
      "get": {
        "operationId": "quotes.get",
        "summary": "Get a quote",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "quotes:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "quotes:write"
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders": {
      "get": {
        "operationId": "orders.list",
        "summary": "List orders",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "fulfillment_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "held",
                  "placed",
                  "accepted",
                  "preparing",
                  "ready",
                  "out_for_delivery",
                  "completed",
                  "canceled"
                ]
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "unpaid",
                  "partially_paid",
                  "paid",
                  "partially_refunded",
                  "refunded"
                ]
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "business_date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "business_date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrdersListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "orders.create",
        "summary": "Place an order (priced server-side; Idempotency-Key = order id)",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrdersCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}": {
      "get": {
        "operationId": "orders.get",
        "summary": "Get an order",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:read"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/cancel": {
      "post": {
        "operationId": "orders.cancel",
        "summary": "Cancel an order",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrdersCancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/release": {
      "post": {
        "operationId": "orders.release",
        "summary": "Release a held order to the kitchen",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/hold/extend": {
      "post": {
        "operationId": "orders.extendHold",
        "summary": "Extend a held order's hold (0.3.1; creator only, capped)",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrdersExtendHoldRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/status": {
      "post": {
        "operationId": "orders.updateStatus",
        "summary": "Move fulfillment status",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrdersUpdateStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/payments": {
      "get": {
        "operationId": "payments.listForOrder",
        "summary": "Payments for an order",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:read"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentsListForOrderResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "payments.recordExternal",
        "summary": "Record a tender taken outside core",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsRecordExternalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/{payment_id}": {
      "get": {
        "operationId": "payments.get",
        "summary": "Get a payment",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:read"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers": {
      "get": {
        "operationId": "customers.list",
        "summary": "List customers",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "customers:read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "customers.upsert",
        "summary": "Upsert a customer by email/phone",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "customers:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomersUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customer_id}": {
      "get": {
        "operationId": "customers.get",
        "summary": "Get a customer",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "customers:read"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/lookup": {
      "get": {
        "operationId": "customers.lookup",
        "summary": "Find a customer by email or phone (404 when none)",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "customers:read"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email",
              "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\+[1-9]\\d{6,14}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff": {
      "get": {
        "operationId": "staff.list",
        "summary": "List staff",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "staff:read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff/{staff_id}": {
      "get": {
        "operationId": "staff.get",
        "summary": "Get a staff member",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "staff:read"
        ],
        "parameters": [
          {
            "name": "staff_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffMember"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/drawer-sessions": {
      "get": {
        "operationId": "drawerSessions.list",
        "summary": "Cash drawer sessions (POS shifts) at a location",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "drawer_sessions:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "drawer_sessions:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DrawerSessionsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deliveries": {
      "get": {
        "operationId": "deliveries.list",
        "summary": "List deliveries",
        "tags": [
          "Deliveries"
        ],
        "security": [
          {
            "openpizza": [
              "deliveries:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "deliveries:read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "created_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "quoted",
                  "pending_assignment",
                  "dispatched",
                  "assigned",
                  "picked_up",
                  "delivering",
                  "delivered",
                  "canceled",
                  "failed"
                ]
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveriesListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deliveries/{delivery_id}": {
      "get": {
        "operationId": "deliveries.get",
        "summary": "Get a delivery",
        "tags": [
          "Deliveries"
        ],
        "security": [
          {
            "openpizza": [
              "deliveries:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "deliveries:read"
        ],
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deliveries/{delivery_id}/status": {
      "post": {
        "operationId": "deliveries.updateStatus",
        "summary": "Update delivery status",
        "tags": [
          "Deliveries"
        ],
        "security": [
          {
            "openpizza": [
              "deliveries:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "deliveries:write"
        ],
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveriesUpdateStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/sales/daily": {
      "get": {
        "operationId": "sales.daily",
        "summary": "Daily sales for a location",
        "tags": [
          "Sales"
        ],
        "security": [
          {
            "openpizza": [
              "sales:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "sales:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesDailyResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sales/summary": {
      "get": {
        "operationId": "sales.summary",
        "summary": "Sales summary grouped by location/channel/item/hour/day",
        "tags": [
          "Sales"
        ],
        "security": [
          {
            "openpizza": [
              "sales:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "sales:read"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "location",
                "channel",
                "item",
                "category",
                "hour",
                "day",
                "size"
              ]
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesSummary"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.list",
        "summary": "Pull feed (same envelope as webhooks), oldest first",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/payment-sessions": {
      "post": {
        "operationId": "payments.createSession",
        "summary": "Create a hosted payment session (pay link) for an order",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:write"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsCreateSessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentsCreateSessionResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment-sessions/{session_id}": {
      "get": {
        "operationId": "payments.getSession",
        "summary": "Get a payment session",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:read"
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentsCreateSessionResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/account": {
      "get": {
        "operationId": "payments.account",
        "summary": "Processor account (Connect id) and platform fee schedule",
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "openpizza": [
              "payments:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "payments:read"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentsAccountResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff/{staff_id}/pin": {
      "put": {
        "operationId": "staff.setPin",
        "summary": "Set or clear a staff member's quick-switch PIN",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:set_pin"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "staff:set_pin"
        ],
        "parameters": [
          {
            "name": "staff_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffSetPinRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffMember"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/sales/hourly": {
      "get": {
        "operationId": "sales.hourly",
        "summary": "Hourly sales buckets (location-local hours)",
        "tags": [
          "Sales"
        ],
        "security": [
          {
            "openpizza": [
              "sales:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "sales:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesHourlyResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sales/items": {
      "get": {
        "operationId": "sales.items",
        "summary": "Item-level sales per business date",
        "tags": [
          "Sales"
        ],
        "security": [
          {
            "openpizza": [
              "sales:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "sales:read"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesItemsResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tips": {
      "get": {
        "operationId": "tips.list",
        "summary": "Normalised tip facts (tender tips vs order tips, no double count)",
        "tags": [
          "Sales"
        ],
        "security": [
          {
            "openpizza": [
              "tips:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "tips:read"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TipsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/locations/{location_id}/kitchen-load": {
      "get": {
        "operationId": "kitchen.load",
        "summary": "Live kitchen load signal for a location",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "openpizza": [
              "orders:read"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "orders:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KitchenLoadResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog/allergens": {
      "put": {
        "operationId": "menu.publishAllergens",
        "summary": "Publish the allergen matrix (emits menu.allergens.published)",
        "tags": [
          "Menu"
        ],
        "security": [
          {
            "openpizza": [
              "menu.allergens:write"
            ]
          }
        ],
        "x-openpizza-served-by": "adapter",
        "x-required-scopes": [
          "menu.allergens:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuPublishAllergensRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuPublishAllergensResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/ingest": {
      "post": {
        "operationId": "events.ingest",
        "summary": "Publish a module event (module namespace only)",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "openpizza": [
              "events:publish"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:publish"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventsIngestRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsIngestResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints": {
      "get": {
        "operationId": "webhookEndpoints.list",
        "summary": "List webhook endpoints",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "webhookEndpoints.create",
        "summary": "Register a webhook endpoint (secret shown once)",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointsCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointsCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpoint_id}": {
      "get": {
        "operationId": "webhookEndpoints.get",
        "summary": "Get a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "webhookEndpoints.update",
        "summary": "Update url/types/status",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointsUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "webhookEndpoints.delete",
        "summary": "Delete a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpoint_id}/rotate-secret": {
      "post": {
        "operationId": "webhookEndpoints.rotateSecret",
        "summary": "Rotate the signing secret (old one signs for 24h more)",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointsRotateSecretResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpoint_id}/replay": {
      "post": {
        "operationId": "webhookEndpoints.replay",
        "summary": "Replay events (by id or time range) to this endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointsReplayRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointsReplayResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpoint_id}/deliveries": {
      "get": {
        "operationId": "webhookEndpoints.deliveries",
        "summary": "Delivery log for this endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "openpizza": [
              "events:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "events:subscribe"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "pending",
                  "retrying",
                  "delivered",
                  "dead",
                  "canceled"
                ]
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointsDeliveriesResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/directory/tenants": {
      "get": {
        "operationId": "directory.tenants.list",
        "summary": "Tenants that enabled the calling module",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "openpizza": [
              "directory:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "directory:read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryTenantsListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/directory/tenants/{slug}": {
      "get": {
        "operationId": "directory.tenants.get",
        "summary": "Look up a tenant (that enabled the calling module) by slug",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "openpizza": [
              "directory:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "directory:read"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryTenantsGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/directory/locations": {
      "get": {
        "operationId": "directory.locations.search",
        "summary": "Geo search across tenants that enabled the calling module",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "openpizza": [
              "directory:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "directory:read"
        ],
        "parameters": [
          {
            "name": "near",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?$"
            }
          },
          {
            "name": "radius_km",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 200
            }
          },
          {
            "name": "open_at",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryLocationsSearchResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/modules/{module}/settings": {
      "get": {
        "operationId": "moduleSettings.get",
        "summary": "Per-tenant module settings",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "openpizza": [
              "entitlements:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "entitlements:read"
        ],
        "parameters": [
          {
            "name": "module",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleSettingsGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "moduleSettings.update",
        "summary": "Patch module settings (needs <module>:admin; own module or POS)",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "openpizza": [
              "entitlements:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "entitlements:read"
        ],
        "parameters": [
          {
            "name": "module",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModuleSettingsUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleSettingsGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/pairings": {
      "post": {
        "operationId": "devices.createPairing",
        "summary": "Create a one-time device pairing code (kiosk, board, terminal, KDS)",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": [
              "devices:pair"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "devices:pair"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesCreatePairingRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesCreatePairingResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices": {
      "get": {
        "operationId": "devices.list",
        "summary": "Paired devices",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": [
              "devices:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "devices:read"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{device_id}/revoke": {
      "post": {
        "operationId": "devices.revoke",
        "summary": "Revoke a device credential",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": [
              "devices:write"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "devices:write"
        ],
        "parameters": [
          {
            "name": "device_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesRevokeResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/pairings/on-behalf": {
      "post": {
        "operationId": "devices.createPairingOnBehalf",
        "summary": "Create a pairing code for a signed-in staff member (0.3.2; module client + staff_token, no devices:pair)",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": []
          }
        ],
        "x-openpizza-served-by": "hub",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesCreatePairingOnBehalfRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesCreatePairingResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{device_id}/revoke/own": {
      "post": {
        "operationId": "devices.revokeOwn",
        "summary": "Revoke a device your module paired (0.3.3; module client, no staff token, no devices:* scope)",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": []
          }
        ],
        "x-openpizza-served-by": "hub",
        "parameters": [
          {
            "name": "device_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesRevokeResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{device_id}/revoke/on-behalf": {
      "post": {
        "operationId": "devices.revokeOnBehalf",
        "summary": "Revoke a device for a signed-in staff member (0.3.2; module client + staff_token)",
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "openpizza": []
          }
        ],
        "x-openpizza-served-by": "hub",
        "parameters": [
          {
            "name": "device_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesRevokeOnBehalfRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesRevokeResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff/{staff_id}/login-identity/reset": {
      "post": {
        "operationId": "staff.resetLoginIdentity",
        "summary": "Forget a staff member's staff-login email binding (0.3.1; owner staff session)",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:write"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "staff:write"
        ],
        "parameters": [
          {
            "name": "staff_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResetLoginIdentityResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff/roster": {
      "get": {
        "operationId": "staff.roster",
        "summary": "Active staff roster: ids, names, roles, locations; no contact info (0.3.3; staff:roster, clock devices)",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:roster"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "staff:roster"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffRosterResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/staff/verify-pin": {
      "post": {
        "operationId": "staff.verifyPin",
        "summary": "Verify a staff PIN → acting-staff session token",
        "tags": [
          "Staff"
        ],
        "security": [
          {
            "openpizza": [
              "staff:pin_verify"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "staff:pin_verify"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffVerifyPinRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffVerifyPinResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customer-auth/challenges": {
      "post": {
        "operationId": "customerAuth.start",
        "summary": "Send a customer one-time code (SMS/email)",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:auth"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "customers:auth"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAuthStartRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAuthStartResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customer-auth/challenges/{challenge_id}/verify": {
      "post": {
        "operationId": "customerAuth.verify",
        "summary": "Verify the code → customer + customer session token",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "openpizza": [
              "customers:auth"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "customers:auth"
        ],
        "parameters": [
          {
            "name": "challenge_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAuthVerifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAuthVerifyResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/realtime/channels/{channel}/nudge": {
      "post": {
        "operationId": "realtime.publish",
        "summary": "Nudge a realtime channel (bumps its version)",
        "tags": [
          "Realtime"
        ],
        "security": [
          {
            "openpizza": [
              "realtime:publish"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "realtime:publish"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimePublishResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/realtime/channels/{channel}/subscribe-token": {
      "post": {
        "operationId": "realtime.subscribeToken",
        "summary": "Client-safe subscribe token + SSE URL for a channel",
        "tags": [
          "Realtime"
        ],
        "security": [
          {
            "openpizza": [
              "realtime:subscribe"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "realtime:subscribe"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeSubscribeTokenResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notifications": {
      "post": {
        "operationId": "notifications.send",
        "summary": "Send an email/SMS through the hub's provider",
        "tags": [
          "Notifications"
        ],
        "security": [
          {
            "openpizza": [
              "notifications:send"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "notifications:send"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationsSendRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationsSendResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notifications/{notification_id}": {
      "get": {
        "operationId": "notifications.get",
        "summary": "Get a notification's status",
        "tags": [
          "Notifications"
        ],
        "security": [
          {
            "openpizza": [
              "notifications:send"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "notifications:send"
        ],
        "parameters": [
          {
            "name": "notification_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationsSendResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/providers": {
      "get": {
        "operationId": "providers.list",
        "summary": "Registered checkout/delivery providers",
        "tags": [
          "Providers"
        ],
        "security": [
          {
            "openpizza": [
              "providers:read"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "providers:read"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "adjustment",
                "tender",
                "gift_card_issuer",
                "delivery"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvidersListResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/providers/{kind}/{key}": {
      "put": {
        "operationId": "providers.register",
        "summary": "Register (upsert) a provider for this tenant (own module key only)",
        "tags": [
          "Providers"
        ],
        "security": [
          {
            "openpizza": [
              "providers:write"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "providers:write"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Replays within 24h return the original response; reuse with a different body → 409 IDEMPOTENCY_CONFLICT.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvidersRegisterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvidersRegisterResponse"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "providers.remove",
        "summary": "Remove a provider registration",
        "tags": [
          "Providers"
        ],
        "security": [
          {
            "openpizza": [
              "providers:write"
            ]
          }
        ],
        "x-openpizza-served-by": "hub",
        "x-required-scopes": [
          "providers:write"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "RFC 9457 problem (stable `code`)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "oauth.token",
        "summary": "client_credentials → short-lived ES256 core token; authorization_code + PKCE → staff token (0.3.1)",
        "tags": [
          "Auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type"
                ],
                "properties": {
                  "grant_type": {
                    "enum": [
                      "client_credentials",
                      "authorization_code"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "description": "authorization_code: the code from GET /authorize (60 s, single use)"
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "authorization_code: the exact redirect_uri used at /authorize"
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "authorization_code: PKCE verifier (S256)"
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-separated subset of the client's scopes"
                  },
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Required for first-party module clients"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "access_token",
                    "token_type",
                    "expires_in",
                    "scope"
                  ],
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "const": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "tenant_id": {
                      "type": "string",
                      "description": "authorization_code: the tenant of the staff token"
                    },
                    "staff": {
                      "type": "object",
                      "description": "authorization_code: the signed-in member (id, name, email, roles, location_ids)"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "OAuth error (invalid_request | invalid_scope | unauthorized_client | unsupported_grant_type | invalid_grant)"
          },
          "401": {
            "description": "invalid_client"
          }
        }
      }
    },
    "/.well-known/jwks.json": {
      "get": {
        "operationId": "jwks.get",
        "summary": "Public ES256 keys for verifying core tokens",
        "tags": [
          "Auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "JWKS",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Tenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "cancelled"
            ]
          },
          "source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "legal_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "mailing_address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string",
                    "minLength": 1
                  },
                  "line2": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1
                  },
                  "region": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  }
                },
                "required": [
                  "line1",
                  "city",
                  "country"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "default_currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "default_timezone": {
            "type": "string",
            "minLength": 1
          },
          "locale": {
            "type": "string",
            "minLength": 2
          },
          "brand": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "logo_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "primary_color": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "website_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "source",
          "default_currency",
          "default_timezone",
          "locale",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "Capabilities": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "features": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payment_modes": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "source",
          "features",
          "events",
          "payment_modes",
          "notes"
        ]
      },
      "Entitlements": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "modules": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "pos",
                "guests",
                "workforce",
                "kitchen",
                "backofhouse",
                "driver",
                "kiosk",
                "catering",
                "sites",
                "boards",
                "pizza_mcp"
              ]
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "enabled",
                    "trial",
                    "disabled",
                    "suspended"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "plan",
                    "addon",
                    "comp",
                    "external"
                  ]
                },
                "plan_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "limits": {
                  "default": {},
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "boolean",
                      "null"
                    ]
                  }
                },
                "config": {
                  "default": {},
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "enabled_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trial_ends_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "status",
                "source",
                "limits",
                "config",
                "enabled_at"
              ]
            }
          },
          "pos": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "tier": {
                    "type": "string"
                  },
                  "max_locations": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "online_ordering": {
                    "type": "boolean"
                  },
                  "advanced_reports": {
                    "type": "boolean"
                  },
                  "delivery": {
                    "type": "boolean"
                  },
                  "max_staff": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "tier",
                  "max_locations",
                  "online_ordering",
                  "advanced_reports",
                  "delivery",
                  "max_staff"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "tenant_id",
          "modules",
          "pos",
          "as_of"
        ]
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\+[1-9]\\d{6,14}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1
              },
              "line2": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": "string",
                "minLength": 1
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "required": [
              "line1",
              "city",
              "country"
            ]
          },
          "geo": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90
                  },
                  "lng": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180
                  }
                },
                "required": [
                  "lat",
                  "lng"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "jurisdiction": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "county": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "code": {
                "type": "string",
                "minLength": 2
              }
            },
            "required": [
              "country",
              "code"
            ]
          },
          "hours": {
            "type": "object",
            "properties": {
              "regular": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "weekday": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6
                    },
                    "windows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "open": {
                            "type": "string",
                            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                          },
                          "close": {
                            "type": "string",
                            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                          }
                        },
                        "required": [
                          "open",
                          "close"
                        ]
                      }
                    }
                  },
                  "required": [
                    "weekday",
                    "windows"
                  ]
                }
              },
              "special": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                    },
                    "closed": {
                      "type": "boolean"
                    },
                    "windows": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "open": {
                            "type": "string",
                            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                          },
                          "close": {
                            "type": "string",
                            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                          }
                        },
                        "required": [
                          "open",
                          "close"
                        ]
                      }
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "date",
                    "closed",
                    "windows"
                  ]
                }
              },
              "services": {
                "default": {},
                "type": "object",
                "properties": {
                  "pickup": {
                    "type": "object",
                    "properties": {
                      "regular": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "weekday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "windows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            }
                          },
                          "required": [
                            "weekday",
                            "windows"
                          ]
                        }
                      },
                      "special": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string",
                              "format": "date",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                            },
                            "closed": {
                              "type": "boolean"
                            },
                            "windows": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            },
                            "label": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "date",
                            "closed",
                            "windows"
                          ]
                        }
                      }
                    },
                    "required": [
                      "regular",
                      "special"
                    ]
                  },
                  "delivery": {
                    "type": "object",
                    "properties": {
                      "regular": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "weekday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "windows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            }
                          },
                          "required": [
                            "weekday",
                            "windows"
                          ]
                        }
                      },
                      "special": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string",
                              "format": "date",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                            },
                            "closed": {
                              "type": "boolean"
                            },
                            "windows": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            },
                            "label": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "date",
                            "closed",
                            "windows"
                          ]
                        }
                      }
                    },
                    "required": [
                      "regular",
                      "special"
                    ]
                  },
                  "dine_in": {
                    "type": "object",
                    "properties": {
                      "regular": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "weekday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "windows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            }
                          },
                          "required": [
                            "weekday",
                            "windows"
                          ]
                        }
                      },
                      "special": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string",
                              "format": "date",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                            },
                            "closed": {
                              "type": "boolean"
                            },
                            "windows": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ]
                              }
                            },
                            "label": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "date",
                            "closed",
                            "windows"
                          ]
                        }
                      }
                    },
                    "required": [
                      "regular",
                      "special"
                    ]
                  }
                }
              }
            },
            "required": [
              "regular",
              "special",
              "services"
            ]
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "pickup_enabled": {
                "type": "boolean"
              },
              "delivery_enabled": {
                "type": "boolean"
              },
              "dine_in_enabled": {
                "default": true,
                "type": "boolean"
              },
              "accepting_orders": {
                "default": true,
                "type": "boolean"
              },
              "prep_minutes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "scheduling_lead_minutes": {
                "default": 0,
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "scheduling_horizon_days": {
                "default": 7,
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "delivery_zones": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "name": {
                      "type": "string"
                    },
                    "postal_codes": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "center": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90
                            },
                            "lng": {
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180
                            }
                          },
                          "required": [
                            "lat",
                            "lng"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "radius_m": {
                      "anyOf": [
                        {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "polygon": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "prefixItems": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "number"
                              }
                            ],
                            "items": false,
                            "minItems": 2,
                            "maxItems": 2
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fee_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "eta_minutes": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "min_subtotal_cents": {
                      "default": 0,
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "postal_codes",
                    "fee_cents",
                    "eta_minutes",
                    "min_subtotal_cents"
                  ]
                }
              },
              "delivery_providers": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tip_presets_bps": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100000
                }
              },
              "max_line_quantity": {
                "default": 50,
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "pickup_enabled",
              "delivery_enabled",
              "dine_in_enabled",
              "accepting_orders",
              "prep_minutes",
              "scheduling_lead_minutes",
              "scheduling_horizon_days",
              "delivery_zones",
              "delivery_providers",
              "tip_presets_bps",
              "max_line_quantity"
            ]
          },
          "pricing": {
            "type": "object",
            "properties": {
              "tax_rate_bps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              },
              "delivery_fee_taxable": {
                "default": false,
                "type": "boolean"
              },
              "service_fee_bps": {
                "default": 0,
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              },
              "service_fee_taxable": {
                "default": true,
                "type": "boolean"
              }
            },
            "required": [
              "tax_rate_bps",
              "delivery_fee_taxable",
              "service_fee_bps",
              "service_fee_taxable"
            ]
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.]*$"
            }
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "slug",
          "status",
          "timezone",
          "currency",
          "address",
          "geo",
          "jurisdiction",
          "hours",
          "fulfillment",
          "pricing",
          "payment_methods",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "Menu": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sort_order": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "category_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "kind": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.]*$"
                      },
                      "sizes": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "price_cents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "diameter_in": {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "exclusiveMinimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "slices": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "availability": {
                              "type": "object",
                              "properties": {
                                "available": {
                                  "type": "boolean"
                                },
                                "reason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "available"
                              ]
                            },
                            "sort_order": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "external_ids": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "price_cents",
                            "availability",
                            "sort_order",
                            "external_ids"
                          ]
                        }
                      },
                      "modifier_groups": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.]*$"
                            },
                            "role_inferred": {
                              "default": false,
                              "type": "boolean"
                            },
                            "min_select": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "max_select": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "supports_half": {
                              "type": "boolean"
                            },
                            "default_modifier_ids": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                              }
                            },
                            "modifiers": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "group_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                                  },
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "price_cents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "price_by_size": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "availability": {
                                    "type": "object",
                                    "properties": {
                                      "available": {
                                        "type": "boolean"
                                      },
                                      "reason": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "until": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "available"
                                    ]
                                  },
                                  "allergens": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "contains": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "milk",
                                                "eggs",
                                                "fish",
                                                "shellfish",
                                                "tree_nuts",
                                                "peanuts",
                                                "wheat",
                                                "soy",
                                                "sesame"
                                              ]
                                            }
                                          },
                                          "may_contain": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "milk",
                                                "eggs",
                                                "fish",
                                                "shellfish",
                                                "tree_nuts",
                                                "peanuts",
                                                "wheat",
                                                "soy",
                                                "sesame"
                                              ]
                                            }
                                          },
                                          "eu": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "contains": {
                                                    "default": [],
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "enum": [
                                                        "cereals_gluten",
                                                        "crustaceans",
                                                        "eggs",
                                                        "fish",
                                                        "peanuts",
                                                        "soybeans",
                                                        "milk",
                                                        "nuts",
                                                        "celery",
                                                        "mustard",
                                                        "sesame",
                                                        "sulphites",
                                                        "lupin",
                                                        "molluscs"
                                                      ]
                                                    }
                                                  },
                                                  "may_contain": {
                                                    "default": [],
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "enum": [
                                                        "cereals_gluten",
                                                        "crustaceans",
                                                        "eggs",
                                                        "fish",
                                                        "peanuts",
                                                        "soybeans",
                                                        "milk",
                                                        "nuts",
                                                        "celery",
                                                        "mustard",
                                                        "sesame",
                                                        "sulphites",
                                                        "lupin",
                                                        "molluscs"
                                                      ]
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "contains",
                                                  "may_contain"
                                                ]
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "version": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "contains",
                                          "may_contain"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "dietary_tags": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_.]*$"
                                    }
                                  },
                                  "sort_order": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "external_ids": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "group_id",
                                  "name",
                                  "price_cents",
                                  "availability",
                                  "dietary_tags",
                                  "sort_order",
                                  "external_ids"
                                ]
                              }
                            },
                            "sort_order": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "external_ids": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "role",
                            "role_inferred",
                            "min_select",
                            "max_select",
                            "supports_half",
                            "default_modifier_ids",
                            "modifiers",
                            "sort_order",
                            "external_ids"
                          ]
                        }
                      },
                      "half_and_half": {
                        "type": "object",
                        "properties": {
                          "allowed": {
                            "type": "boolean"
                          },
                          "pricing_rule": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.]*$"
                          },
                          "specialty_halves": {
                            "default": false,
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "allowed",
                          "pricing_rule",
                          "specialty_halves"
                        ]
                      },
                      "availability": {
                        "type": "object",
                        "properties": {
                          "available": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "until": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "available"
                        ]
                      },
                      "allergens": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "contains": {
                                "default": [],
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "milk",
                                    "eggs",
                                    "fish",
                                    "shellfish",
                                    "tree_nuts",
                                    "peanuts",
                                    "wheat",
                                    "soy",
                                    "sesame"
                                  ]
                                }
                              },
                              "may_contain": {
                                "default": [],
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "milk",
                                    "eggs",
                                    "fish",
                                    "shellfish",
                                    "tree_nuts",
                                    "peanuts",
                                    "wheat",
                                    "soy",
                                    "sesame"
                                  ]
                                }
                              },
                              "eu": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "contains": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "cereals_gluten",
                                            "crustaceans",
                                            "eggs",
                                            "fish",
                                            "peanuts",
                                            "soybeans",
                                            "milk",
                                            "nuts",
                                            "celery",
                                            "mustard",
                                            "sesame",
                                            "sulphites",
                                            "lupin",
                                            "molluscs"
                                          ]
                                        }
                                      },
                                      "may_contain": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "cereals_gluten",
                                            "crustaceans",
                                            "eggs",
                                            "fish",
                                            "peanuts",
                                            "soybeans",
                                            "milk",
                                            "nuts",
                                            "celery",
                                            "mustard",
                                            "sesame",
                                            "sulphites",
                                            "lupin",
                                            "molluscs"
                                          ]
                                        }
                                      }
                                    },
                                    "required": [
                                      "contains",
                                      "may_contain"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "version": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "contains",
                              "may_contain"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "dietary_tags": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.]*$"
                        }
                      },
                      "tags": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "images": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "alt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "width": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "height": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "url"
                          ]
                        }
                      },
                      "calories": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "station": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.]*$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tax_exempt": {
                        "default": false,
                        "type": "boolean"
                      },
                      "sort_order": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "external_ids": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "category_id",
                      "name",
                      "kind",
                      "sizes",
                      "modifier_groups",
                      "half_and_half",
                      "availability",
                      "dietary_tags",
                      "tags",
                      "images",
                      "tax_exempt",
                      "sort_order",
                      "external_ids"
                    ]
                  }
                },
                "external_ids": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "sort_order",
                "items",
                "external_ids"
              ]
            }
          }
        },
        "required": [
          "tenant_id",
          "location_id",
          "currency",
          "version",
          "as_of",
          "categories"
        ]
      },
      "Quote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "menu_version": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "line_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "item_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "item_name": {
                  "type": "string"
                },
                "category_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "station": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "base_price_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "modifiers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "group_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "group_name": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.]*$"
                      },
                      "modifier_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "modifier_name": {
                        "type": "string"
                      },
                      "placement": {
                        "type": "string",
                        "enum": [
                          "whole",
                          "left",
                          "right"
                        ]
                      },
                      "price_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "group_id",
                      "group_name",
                      "role",
                      "modifier_id",
                      "modifier_name",
                      "placement",
                      "price_cents"
                    ]
                  }
                },
                "unit_price_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "line_total_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tax_exempt": {
                  "default": false,
                  "type": "boolean"
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "voided": {
                  "type": "boolean"
                },
                "fired_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "voided_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status_at_void": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "held",
                        "placed",
                        "accepted",
                        "preparing",
                        "ready",
                        "out_for_delivery",
                        "completed",
                        "canceled"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "line_type",
                "item_id",
                "item_name",
                "size_id",
                "size_name",
                "quantity",
                "base_price_cents",
                "modifiers",
                "unit_price_cents",
                "line_total_cents",
                "discount_cents",
                "net_cents",
                "tax_exempt",
                "notes",
                "voided"
              ]
            }
          },
          "adjustments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "source_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "percent_bps": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "line_ids": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "type",
                "source",
                "label",
                "amount_cents"
              ]
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "subtotal_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "discount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "service_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "delivery_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "taxable_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tax_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tip_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "total_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "fees_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "subtotal_cents",
              "discount_cents",
              "service_fee_cents",
              "delivery_fee_cents",
              "taxable_cents",
              "tax_cents",
              "tip_cents",
              "total_cents"
            ]
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "scheduled_for": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "promised_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "line1": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "city": {
                        "type": "string",
                        "minLength": 1
                      },
                      "region": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "postal_code": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    },
                    "required": [
                      "line1",
                      "city",
                      "country"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "zone_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "table": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "type",
              "scheduled_for",
              "promised_at"
            ]
          },
          "tax_exempt": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "quote_hash": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "fee_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "fee",
                    "gratuity"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "percent_bps": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "taxable": {
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "kind",
                "label",
                "amount_cents",
                "taxable"
              ]
            }
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "currency",
          "menu_version",
          "valid",
          "lines",
          "adjustments",
          "totals",
          "fulfillment",
          "tax_exempt",
          "errors",
          "quote_hash",
          "created_at",
          "expires_at"
        ]
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "order_number": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "channel": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "module": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "agent_client_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "offline_synced": {
                "default": false,
                "type": "boolean"
              },
              "device_id": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "offline_synced"
            ]
          },
          "fulfillment_status": {
            "type": "string",
            "enum": [
              "held",
              "placed",
              "accepted",
              "preparing",
              "ready",
              "out_for_delivery",
              "completed",
              "canceled"
            ]
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "unpaid",
              "partially_paid",
              "paid",
              "partially_refunded",
              "refunded"
            ]
          },
          "hold": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.]*$"
                  },
                  "expires_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "reason",
                  "expires_at"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "fire_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "line_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "item_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "item_name": {
                  "type": "string"
                },
                "category_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "station": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.]*$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "base_price_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "modifiers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "group_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "group_name": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.]*$"
                      },
                      "modifier_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "modifier_name": {
                        "type": "string"
                      },
                      "placement": {
                        "type": "string",
                        "enum": [
                          "whole",
                          "left",
                          "right"
                        ]
                      },
                      "price_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "group_id",
                      "group_name",
                      "role",
                      "modifier_id",
                      "modifier_name",
                      "placement",
                      "price_cents"
                    ]
                  }
                },
                "unit_price_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "line_total_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tax_exempt": {
                  "default": false,
                  "type": "boolean"
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "voided": {
                  "type": "boolean"
                },
                "fired_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "voided_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status_at_void": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "held",
                        "placed",
                        "accepted",
                        "preparing",
                        "ready",
                        "out_for_delivery",
                        "completed",
                        "canceled"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "line_type",
                "item_id",
                "item_name",
                "size_id",
                "size_name",
                "quantity",
                "base_price_cents",
                "modifiers",
                "unit_price_cents",
                "line_total_cents",
                "discount_cents",
                "net_cents",
                "tax_exempt",
                "notes",
                "voided"
              ]
            }
          },
          "adjustments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "source_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "percent_bps": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "line_ids": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "type",
                "source",
                "label",
                "amount_cents"
              ]
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "subtotal_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "discount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "service_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "delivery_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "taxable_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tax_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tip_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "total_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "fees_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "subtotal_cents",
              "discount_cents",
              "service_fee_cents",
              "delivery_fee_cents",
              "taxable_cents",
              "tax_cents",
              "tip_cents",
              "total_cents"
            ]
          },
          "tenders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "payment_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "method": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "processor": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tip_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "refunded_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "payment_id",
                "method",
                "status",
                "amount_cents",
                "tip_cents",
                "refunded_cents"
              ]
            }
          },
          "amount_due_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "scheduled_for": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "promised_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "line1": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "city": {
                        "type": "string",
                        "minLength": 1
                      },
                      "region": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "postal_code": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    },
                    "required": [
                      "line1",
                      "city",
                      "country"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "zone_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "table": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "type",
              "scheduled_for",
              "promised_at"
            ]
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\+[1-9]\\d{6,14}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "staff_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "quote_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_exempt": {
            "default": false,
            "type": "boolean"
          },
          "business_date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "metadata": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "placed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "canceled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancel_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status_at_void": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "held",
                  "placed",
                  "accepted",
                  "preparing",
                  "ready",
                  "out_for_delivery",
                  "completed",
                  "canceled"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "status_history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "held",
                    "placed",
                    "accepted",
                    "preparing",
                    "ready",
                    "out_for_delivery",
                    "completed",
                    "canceled"
                  ]
                },
                "at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                "by": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "status",
                "at"
              ]
            }
          },
          "callout_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "fee_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "fee",
                    "gratuity"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "percent_bps": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "taxable": {
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "kind",
                "label",
                "amount_cents",
                "taxable"
              ]
            }
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "order_number",
          "version",
          "channel",
          "source",
          "fulfillment_status",
          "payment_status",
          "hold",
          "fire_at",
          "currency",
          "lines",
          "adjustments",
          "totals",
          "tenders",
          "amount_due_cents",
          "fulfillment",
          "customer_id",
          "staff_id",
          "notes",
          "tax_exempt",
          "business_date",
          "metadata",
          "external_ids",
          "created_at",
          "updated_at",
          "placed_at",
          "completed_at",
          "canceled_at"
        ]
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "order_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "method": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "processor": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "requires_action",
              "pending",
              "authorized",
              "captured",
              "failed",
              "canceled",
              "refunded",
              "partially_refunded"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "amount_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "refunded_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "application_fee_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "processing_fee_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "card": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "brand": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "last4": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "cash_tendered_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "cash_change_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "processor_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "staff_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "simulated": {
            "default": false,
            "type": "boolean"
          },
          "collection": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "refunds": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                "processor_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "amount_cents",
                "at"
              ]
            }
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "order_id",
          "method",
          "status",
          "currency",
          "amount_cents",
          "tip_cents",
          "refunded_cents",
          "application_fee_cents",
          "simulated",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\+[1-9]\\d{6,14}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified": {
            "type": "boolean"
          },
          "marketing": {
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "opt_in": {
                    "type": "boolean"
                  },
                  "at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "user_agent": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "captured_by": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "opt_in"
                ]
              },
              "sms": {
                "type": "object",
                "properties": {
                  "opt_in": {
                    "type": "boolean"
                  },
                  "at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "user_agent": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "captured_by": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "opt_in"
                ]
              }
            },
            "required": [
              "email",
              "sms"
            ]
          },
          "stats": {
            "type": "object",
            "properties": {
              "order_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "last_order_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lifetime_spend_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "order_count",
              "last_order_at",
              "lifetime_spend_cents"
            ]
          },
          "tags": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "email",
          "phone",
          "name",
          "verified",
          "marketing",
          "stats",
          "tags",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "StaffMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "manager",
              "cashier",
              "kitchen",
              "employee",
              "driver",
              "dispatcher",
              "catering_manager"
            ]
          },
          "roles": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "owner",
                "manager",
                "cashier",
                "kitchen",
                "employee",
                "driver",
                "dispatcher",
                "catering_manager"
              ]
            }
          },
          "active": {
            "type": "boolean"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "location_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\+[1-9]\\d{6,14}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "has_pin": {
            "type": "boolean"
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "role",
          "roles",
          "active",
          "user_id",
          "location_ids",
          "has_pin",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "DrawerSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "staff_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "opened_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "opening_float_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "cash_sales_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "paid_in_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "payouts_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expected_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "counted_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "over_short_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "close_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "staff_id",
          "status",
          "currency",
          "opened_at",
          "closed_at",
          "opening_float_cents",
          "cash_sales_cents",
          "paid_in_cents",
          "payouts_cents",
          "expected_cents",
          "counted_cents",
          "over_short_cents",
          "close_note",
          "business_date"
        ]
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "order_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "provider": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "quoted",
              "pending_assignment",
              "dispatched",
              "assigned",
              "picked_up",
              "delivering",
              "delivered",
              "canceled",
              "failed"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "fee_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "amount_due_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "eta_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "promised_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "pickup": {
            "type": "object",
            "properties": {
              "address": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string",
                    "minLength": 1
                  },
                  "line2": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1
                  },
                  "region": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  }
                },
                "required": [
                  "line1",
                  "city",
                  "country"
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "address",
              "geo"
            ]
          },
          "dropoff": {
            "type": "object",
            "properties": {
              "address": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string",
                    "minLength": 1
                  },
                  "line2": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1
                  },
                  "region": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  }
                },
                "required": [
                  "line1",
                  "city",
                  "country"
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "contact": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\+[1-9]\\d{6,14}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "address",
              "geo",
              "contact"
            ]
          },
          "driver": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "staff_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "items_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_delivery_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracking_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "simulated": {
            "default": false,
            "type": "boolean"
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "order_id",
          "provider",
          "status",
          "currency",
          "fee_cents",
          "tip_cents",
          "amount_due_cents",
          "eta_minutes",
          "promised_at",
          "pickup",
          "dropoff",
          "driver",
          "provider_delivery_id",
          "tracking_url",
          "simulated",
          "external_ids",
          "created_at",
          "updated_at"
        ]
      },
      "DailySales": {
        "type": "object",
        "properties": {
          "order_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "units": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "gross_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "discount_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "tax_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "delivery_fee_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "service_fee_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "refund_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "void_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "business_date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "by_channel": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "units": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "gross_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "tax_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tip_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "delivery_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "service_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "refund_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "void_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "order_count",
                "units",
                "gross_cents",
                "discount_cents",
                "net_cents",
                "tax_cents",
                "tip_cents",
                "delivery_fee_cents",
                "service_fee_cents",
                "refund_cents",
                "void_count",
                "key",
                "label"
              ]
            }
          },
          "payment_mix": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tip_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "application_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "method",
                "count",
                "amount_cents",
                "tip_cents",
                "application_fee_cents"
              ]
            }
          },
          "closed": {
            "type": "boolean"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "order_count",
          "units",
          "gross_cents",
          "discount_cents",
          "net_cents",
          "tax_cents",
          "tip_cents",
          "delivery_fee_cents",
          "service_fee_cents",
          "refund_cents",
          "void_count",
          "tenant_id",
          "location_id",
          "business_date",
          "currency",
          "by_channel",
          "payment_mix",
          "closed",
          "closed_at"
        ]
      },
      "SalesSummary": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "from": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "to": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "group_by": {
            "type": "string",
            "enum": [
              "location",
              "channel",
              "item",
              "category",
              "hour",
              "day",
              "size"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "totals": {
            "type": "object",
            "properties": {
              "order_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "gross_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "discount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "net_cents": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "tax_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tip_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "delivery_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "service_fee_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "refund_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "void_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "order_count",
              "units",
              "gross_cents",
              "discount_cents",
              "net_cents",
              "tax_cents",
              "tip_cents",
              "delivery_fee_cents",
              "service_fee_cents",
              "refund_cents",
              "void_count"
            ]
          },
          "buckets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "units": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "gross_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "tax_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tip_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "delivery_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "service_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "refund_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "void_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "order_count",
                "units",
                "gross_cents",
                "discount_cents",
                "net_cents",
                "tax_cents",
                "tip_cents",
                "delivery_fee_cents",
                "service_fee_cents",
                "refund_cents",
                "void_count",
                "key",
                "label"
              ]
            }
          }
        },
        "required": [
          "tenant_id",
          "location_id",
          "from",
          "to",
          "group_by",
          "currency",
          "totals",
          "buckets"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
          },
          "type": {
            "type": "string",
            "minLength": 1
          },
          "spec_version": {
            "type": "string",
            "const": "1"
          },
          "data_version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "version": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "type",
              "id",
              "version"
            ]
          },
          "sequence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "data": {},
          "changes": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "array",
                  "prefixItems": [
                    {},
                    {}
                  ],
                  "items": false,
                  "minItems": 2,
                  "maxItems": 2
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "endpoint_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "spec_version",
          "data_version",
          "occurred_at",
          "tenant_id",
          "location_id",
          "source",
          "subject",
          "sequence",
          "data"
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "module": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "failing_since": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_ids": {
            "description": "creating client's location allow-list (null = all)",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "secret_hint": {
            "type": [
              "string",
              "null"
            ]
          },
          "rotating": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "client_id",
          "module",
          "url",
          "description",
          "types",
          "status",
          "disabled_reason",
          "failing_since",
          "secret_hint",
          "rotating",
          "created_at",
          "updated_at"
        ]
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "instance": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "details": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "suggestions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "action": {
                      "type": "string"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "candidates": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "action"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "ask_user": {
            "type": [
              "string",
              "null"
            ]
          },
          "docs": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "errors": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "retryable"
        ]
      },
      "LocationsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "MenuSetAvailabilityResponse": {
        "type": "object",
        "properties": {
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "target_type": {
            "type": "string",
            "enum": [
              "item",
              "size",
              "modifier"
            ]
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "availability": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "until": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "available"
            ]
          }
        },
        "required": [
          "location_id",
          "target_type",
          "target_id",
          "availability"
        ]
      },
      "OrdersListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PaymentsListForOrderResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CustomersListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Customer"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "StaffListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StaffMember"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "DrawerSessionsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DrawerSession"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "DeliveriesListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SalesDailyResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailySales"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "EventsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PaymentsCreateSessionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "order_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "completed",
              "expired",
              "canceled"
            ]
          },
          "url": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "amount_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "processor": {
            "type": "string"
          },
          "payment_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "simulated": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "order_id",
          "status",
          "url",
          "currency",
          "amount_cents",
          "tip_cents",
          "processor",
          "payment_id",
          "expires_at",
          "created_at",
          "simulated"
        ]
      },
      "PaymentsAccountResponse": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "processor": {
            "type": "string"
          },
          "connect_account_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "charges_enabled": {
            "type": "boolean"
          },
          "payouts_enabled": {
            "type": "boolean"
          },
          "default_currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "platform_fee": {
            "type": "object",
            "properties": {
              "bps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "fixed_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "max_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "bps",
              "fixed_cents",
              "max_cents"
            ]
          },
          "simulated": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "tenant_id",
          "processor",
          "connect_account_id",
          "charges_enabled",
          "payouts_enabled",
          "default_currency",
          "platform_fee",
          "simulated"
        ]
      },
      "SalesHourlyResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "location_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                "business_date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                "hour": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 23
                },
                "order_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "gross_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tip_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "location_id",
                "date",
                "business_date",
                "hour",
                "order_count",
                "net_cents",
                "gross_cents",
                "tip_cents"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "SalesItemsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "location_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "business_date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                "item_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "item_name": {
                  "type": "string"
                },
                "size_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "category_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "units": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "order_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "gross_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "location_id",
                "business_date",
                "item_id",
                "item_name",
                "size_id",
                "size_name",
                "category_id",
                "units",
                "order_count",
                "gross_cents",
                "discount_cents",
                "net_cents"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "TipsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "tenant_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "location_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "order_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "payment_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "business_date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "card",
                    "cash_on_tender",
                    "online",
                    "adjustment"
                  ]
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "processing_fee_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "staff_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "adjusts": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              },
              "required": [
                "id",
                "tenant_id",
                "location_id",
                "order_id",
                "payment_id",
                "business_date",
                "kind",
                "currency",
                "amount_cents",
                "processing_fee_cents",
                "staff_id",
                "occurred_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "KitchenLoadResponse": {
        "type": "object",
        "properties": {
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "active_orders": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "active_items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "by_status": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "held",
                "placed",
                "accepted",
                "preparing",
                "ready",
                "out_for_delivery",
                "completed",
                "canceled"
              ]
            },
            "additionalProperties": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "orders_last_15m": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "oldest_active_placed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "quoted_ready_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "level": {
            "type": "string",
            "enum": [
              "idle",
              "normal",
              "busy",
              "slammed"
            ]
          },
          "accepting_orders": {
            "type": "boolean"
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "location_id",
          "active_orders",
          "active_items",
          "by_status",
          "orders_last_15m",
          "oldest_active_placed_at",
          "quoted_ready_minutes",
          "level",
          "accepting_orders",
          "as_of"
        ]
      },
      "MenuPublishAllergensResponse": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "version": {
            "type": "string"
          },
          "payload_hash": {
            "type": "string"
          },
          "location_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "row_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "published_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "tenant_id",
          "version",
          "payload_hash",
          "location_ids",
          "row_count",
          "published_by",
          "published_at"
        ]
      },
      "EventsIngestResponse": {
        "type": "object",
        "properties": {
          "event": {
            "$ref": "#/components/schemas/Event"
          },
          "duplicate": {
            "type": "boolean"
          }
        },
        "required": [
          "event",
          "duplicate"
        ]
      },
      "WebhookEndpointsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "WebhookEndpointsCreateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "module": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "failing_since": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_ids": {
            "description": "creating client's location allow-list (null = all)",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "secret_hint": {
            "type": [
              "string",
              "null"
            ]
          },
          "rotating": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "whsec_… — shown once"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "client_id",
          "module",
          "url",
          "description",
          "types",
          "status",
          "disabled_reason",
          "failing_since",
          "secret_hint",
          "rotating",
          "created_at",
          "updated_at",
          "secret"
        ]
      },
      "WebhookEndpointsRotateSecretResponse": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string"
          },
          "previous_valid_until": {
            "type": "string"
          }
        },
        "required": [
          "secret",
          "previous_valid_until"
        ]
      },
      "WebhookEndpointsReplayResponse": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "delivery_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "replayed",
          "delivery_ids"
        ]
      },
      "WebhookEndpointsDeliveriesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "endpoint_id": {
                  "type": "string"
                },
                "event_id": {
                  "type": "string"
                },
                "event_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "retrying",
                    "delivered",
                    "dead",
                    "canceled"
                  ]
                },
                "attempts": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "next_attempt_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "last_status_code": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_error": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "replay_of": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "delivered_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "event_type",
                "status",
                "attempts",
                "next_attempt_at",
                "last_status_code",
                "last_error",
                "replay_of",
                "created_at",
                "delivered_at"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "DirectoryTenantsListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryTenantsGetResponse"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "DirectoryTenantsGetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "source": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "source"
        ]
      },
      "DirectoryLocationsSearchResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tenant": {
                  "$ref": "#/components/schemas/DirectoryTenantsGetResponse"
                },
                "location": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string",
                      "minLength": 1
                    },
                    "phone": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\+[1-9]\\d{6,14}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "line1": {
                          "type": "string",
                          "minLength": 1
                        },
                        "line2": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": "string",
                          "minLength": 1
                        },
                        "region": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postal_code": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        }
                      },
                      "required": [
                        "line1",
                        "city",
                        "country"
                      ]
                    },
                    "geo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90
                            },
                            "lng": {
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180
                            }
                          },
                          "required": [
                            "lat",
                            "lng"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pickup_enabled": {
                      "type": "boolean"
                    },
                    "delivery_enabled": {
                      "type": "boolean"
                    },
                    "accepting_orders": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "status",
                    "timezone",
                    "address",
                    "geo",
                    "pickup_enabled",
                    "delivery_enabled",
                    "accepting_orders"
                  ]
                },
                "distance_km": {
                  "type": "number",
                  "minimum": 0
                },
                "open": {
                  "type": "boolean"
                }
              },
              "required": [
                "tenant",
                "location",
                "distance_km",
                "open"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ModuleSettingsGetResponse": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "module": {
            "type": "string",
            "enum": [
              "pos",
              "guests",
              "workforce",
              "kitchen",
              "backofhouse",
              "driver",
              "kiosk",
              "catering",
              "sites",
              "boards",
              "pizza_mcp"
            ]
          },
          "status": {
            "type": "string"
          },
          "settings": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "tenant_id",
          "module",
          "status",
          "settings",
          "updated_at"
        ]
      },
      "DevicesCreatePairingResponse": {
        "type": "object",
        "properties": {
          "pairing_id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9A-HJKMNP-TV-Z]{8}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "kiosk",
              "board",
              "terminal",
              "kds",
              "clock"
            ]
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "pair_url": {
            "type": "string"
          }
        },
        "required": [
          "pairing_id",
          "code",
          "kind",
          "location_id",
          "name",
          "expires_at",
          "pair_url"
        ]
      },
      "DevicesListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DevicesRevokeResponse"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "DevicesRevokeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "kiosk",
              "board",
              "terminal",
              "kds",
              "clock"
            ]
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "last_seen_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "tenant_id",
          "location_id",
          "kind",
          "name",
          "status",
          "scopes",
          "created_at",
          "last_seen_at"
        ]
      },
      "StaffResetLoginIdentityResponse": {
        "type": "object",
        "properties": {
          "reset": {
            "type": "boolean"
          }
        },
        "required": [
          "reset"
        ]
      },
      "StaffRosterResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "name": {
                  "type": "string"
                },
                "display_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "roles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "location_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "has_pin": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "roles",
                "location_ids",
                "has_pin"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "StaffVerifyPinResponse": {
        "type": "object",
        "properties": {
          "staff": {
            "$ref": "#/components/schemas/StaffMember"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "staff",
          "location_id",
          "scopes",
          "token",
          "token_type",
          "expires_at"
        ]
      },
      "CustomerAuthStartResponse": {
        "type": "object",
        "properties": {
          "challenge_id": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "email"
            ]
          },
          "destination": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "simulated_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "challenge_id",
          "channel",
          "destination",
          "expires_at"
        ]
      },
      "CustomerAuthVerifyResponse": {
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "audience": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "customer",
          "token",
          "token_type",
          "audience",
          "expires_at"
        ]
      },
      "RealtimePublishResponse": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string"
          },
          "v": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "channel",
          "v",
          "at"
        ]
      },
      "RealtimeSubscribeTokenResponse": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "v": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "channel",
          "url",
          "token",
          "expires_at",
          "v"
        ]
      },
      "NotificationsSendResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "to": {
            "type": "string"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sent",
              "failed",
              "simulated"
            ]
          },
          "provider": {
            "type": "string"
          },
          "provider_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "sender": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "channel",
          "to",
          "subject",
          "kind",
          "ref",
          "status",
          "provider",
          "provider_ref",
          "error",
          "sender",
          "created_at"
        ]
      },
      "ProvidersListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProvidersRegisterResponse"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ProvidersRegisterResponse": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "adjustment",
              "tender",
              "gift_card_issuer",
              "delivery"
            ]
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "module": {
            "type": [
              "string",
              "null"
            ]
          },
          "base_url": {
            "type": "string"
          },
          "protocol_version": {
            "type": "string"
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "capabilities": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "tenant_id",
          "kind",
          "key",
          "module",
          "base_url",
          "protocol_version",
          "display_name",
          "capabilities",
          "status",
          "created_at",
          "updated_at"
        ]
      },
      "MenuSetAvailabilityRequest": {
        "type": "object",
        "properties": {
          "target_type": {
            "type": "string",
            "enum": [
              "item",
              "size",
              "modifier"
            ]
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "target_type",
          "target_id",
          "available"
        ]
      },
      "QuotesCreateRequest": {
        "type": "object",
        "properties": {
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "item_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "size_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "modifiers": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "modifier_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "placement": {
                        "default": "whole",
                        "type": "string",
                        "enum": [
                          "whole",
                          "left",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "modifier_id"
                    ]
                  }
                },
                "notes": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 500
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "item_id",
                "quantity"
              ]
            }
          },
          "fulfillment": {
            "default": {
              "type": "pickup"
            },
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "scheduled_for": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "line1": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "city": {
                        "type": "string",
                        "minLength": 1
                      },
                      "region": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "postal_code": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    },
                    "required": [
                      "line1",
                      "city",
                      "country"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivery_notes": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "table": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "adjustments": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "source_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "percent_bps": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "line_ids": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "source",
                "label"
              ]
            }
          },
          "tip": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "amount_cents"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "percent_bps": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100000
                      }
                    },
                    "required": [
                      "percent_bps"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_exempt": {
            "default": false,
            "type": "boolean"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "fees": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]*$"
                },
                "kind": {
                  "default": "fee",
                  "type": "string",
                  "enum": [
                    "fee",
                    "gratuity"
                  ]
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "percent_bps": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "taxable": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "label"
              ]
            }
          }
        },
        "required": [
          "location_id",
          "lines"
        ]
      },
      "OrdersCreateRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "quote_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "quote_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "item_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "size_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "modifiers": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "modifier_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      "placement": {
                        "default": "whole",
                        "type": "string",
                        "enum": [
                          "whole",
                          "left",
                          "right"
                        ]
                      }
                    },
                    "required": [
                      "modifier_id"
                    ]
                  }
                },
                "notes": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 500
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "item_id",
                "quantity"
              ]
            }
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "scheduled_for": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "line1": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "city": {
                        "type": "string",
                        "minLength": 1
                      },
                      "region": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "postal_code": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    },
                    "required": [
                      "line1",
                      "city",
                      "country"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "geo": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number",
                        "minimum": -90,
                        "maximum": 90
                      },
                      "lng": {
                        "type": "number",
                        "minimum": -180,
                        "maximum": 180
                      }
                    },
                    "required": [
                      "lat",
                      "lng"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivery_notes": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "table": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "adjustments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]*$"
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "source_ref": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "percent_bps": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "line_ids": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "source",
                "label"
              ]
            }
          },
          "tip": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "amount_cents"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "percent_bps": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100000
                      }
                    },
                    "required": [
                      "percent_bps"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              "module": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "agent_client_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "offline_synced": {
                "default": false,
                "type": "boolean"
              },
              "device_id": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\+[1-9]\\d{6,14}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "staff_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "hold": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.]*$"
                  },
                  "ttl_seconds": {
                    "default": 900,
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 2592000
                  }
                },
                "required": [
                  "reason"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "fire_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_intent": {
            "default": "prepaid",
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "tax_exempt": {
            "default": false,
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "callout_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "fees": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]*$"
                },
                "kind": {
                  "default": "fee",
                  "type": "string",
                  "enum": [
                    "fee",
                    "gratuity"
                  ]
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "percent_bps": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "taxable": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "label"
              ]
            }
          }
        },
        "required": [
          "location_id",
          "channel",
          "source"
        ]
      },
      "OrdersCancelRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "requested_by": {
            "default": "customer",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ]
      },
      "OrdersExtendHoldRequest": {
        "type": "object",
        "properties": {
          "ttl_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 3600
          }
        },
        "required": [
          "ttl_seconds"
        ]
      },
      "OrdersUpdateStatusRequest": {
        "type": "object",
        "properties": {
          "fulfillment_status": {
            "type": "string",
            "enum": [
              "held",
              "placed",
              "accepted",
              "preparing",
              "ready",
              "out_for_delivery",
              "completed",
              "canceled"
            ]
          }
        },
        "required": [
          "fulfillment_status"
        ]
      },
      "PaymentsRecordExternalRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "method": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "processor": {
            "type": "string",
            "minLength": 1
          },
          "processor_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "default": "captured",
            "type": "string",
            "enum": [
              "authorized",
              "captured",
              "pending"
            ]
          },
          "staff_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "collection": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          }
        },
        "required": [
          "method",
          "processor",
          "amount_cents"
        ]
      },
      "CustomersUpsertRequest": {
        "type": "object",
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\+[1-9]\\d{6,14}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketing": {
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "opt_in": {
                    "type": "boolean"
                  },
                  "at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "user_agent": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "captured_by": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "opt_in"
                ]
              },
              "sms": {
                "type": "object",
                "properties": {
                  "opt_in": {
                    "type": "boolean"
                  },
                  "at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "disclosure_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ip": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "user_agent": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "captured_by": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "opt_in"
                ]
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "external_ids": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "DeliveriesUpdateStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "quoted",
              "pending_assignment",
              "dispatched",
              "assigned",
              "picked_up",
              "delivering",
              "delivered",
              "canceled",
              "failed"
            ]
          },
          "driver": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "staff_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "eta_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracking_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_delivery_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "PaymentsCreateSessionRequest": {
        "type": "object",
        "properties": {
          "amount_cents": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "tip_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "success_url": {
            "type": "string",
            "format": "uri"
          },
          "cancel_url": {
            "type": "string",
            "format": "uri"
          },
          "expires_in_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400
          },
          "customer_email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "success_url"
        ]
      },
      "StaffSetPinRequest": {
        "type": "object",
        "properties": {
          "pin": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4,8}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "pin"
        ]
      },
      "MenuPublishAllergensRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "payload_hash": {
            "type": "string",
            "minLength": 8
          },
          "location_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "rows": {
            "maxItems": 20000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "target_type": {
                  "type": "string",
                  "enum": [
                    "item",
                    "size",
                    "modifier"
                  ]
                },
                "target_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "contains": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "may_contain": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "tags": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "target_type",
                "target_id"
              ]
            }
          },
          "published_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "version",
          "payload_hash",
          "rows"
        ]
      },
      "EventsIngestRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
          },
          "type": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z0-9][a-z0-9_]*)+$"
          },
          "subject": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "minLength": 1
              },
              "id": {
                "type": "string",
                "minLength": 1
              },
              "version": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "type",
              "id"
            ]
          },
          "data": {},
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "changes": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "array",
                  "prefixItems": [
                    {},
                    {}
                  ],
                  "items": false,
                  "minItems": 2,
                  "maxItems": 2
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "subject",
          "data"
        ]
      },
      "WebhookEndpointsCreateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "types": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "url"
        ]
      },
      "WebhookEndpointsUpdateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        }
      },
      "WebhookEndpointsReplayRequest": {
        "type": "object",
        "properties": {
          "event_ids": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "only_failed": {
            "type": "boolean"
          }
        }
      },
      "ModuleSettingsUpdateRequest": {
        "type": "object",
        "properties": {
          "settings": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "merge": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "settings"
        ]
      },
      "DevicesCreatePairingRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "kiosk",
              "board",
              "terminal",
              "kds",
              "clock"
            ]
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "ttl_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          }
        },
        "required": [
          "kind",
          "location_id",
          "name"
        ]
      },
      "DevicesCreatePairingOnBehalfRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "kiosk",
              "board",
              "terminal",
              "kds",
              "clock"
            ]
          },
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "ttl_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "staff_token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 8192
          }
        },
        "required": [
          "kind",
          "location_id",
          "name",
          "staff_token"
        ]
      },
      "DevicesRevokeOnBehalfRequest": {
        "type": "object",
        "properties": {
          "staff_token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 8192
          }
        },
        "required": [
          "staff_token"
        ]
      },
      "StaffVerifyPinRequest": {
        "type": "object",
        "properties": {
          "location_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "pin": {
            "type": "string",
            "pattern": "^\\d{4,8}$"
          },
          "staff_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "location_id",
          "pin",
          "staff_id"
        ]
      },
      "CustomerAuthStartRequest": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "email"
            ]
          }
        }
      },
      "CustomerAuthVerifyRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "code"
        ]
      },
      "NotificationsSendRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "to": {
            "type": "string",
            "minLength": 3,
            "maxLength": 320
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "html": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200000
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "default": "transactional",
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.]*$"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "channel",
          "to",
          "body"
        ]
      },
      "ProvidersRegisterRequest": {
        "type": "object",
        "properties": {
          "base_url": {
            "type": "string",
            "format": "uri"
          },
          "protocol_version": {
            "default": "1",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "capabilities": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          }
        },
        "required": [
          "base_url"
        ]
      }
    },
    "securitySchemes": {
      "openpizza": {
        "type": "oauth2",
        "description": "Core machine token (ES256 JWT, aud `openpizza:api`) from /oauth/token; verify with /.well-known/jwks.json.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "tenant:read": "tenant:read",
              "locations:read": "locations:read",
              "locations:write": "locations:write",
              "menu:read": "menu:read",
              "menu:write": "menu:write",
              "menu.availability:write": "menu.availability:write",
              "orders:read": "orders:read",
              "orders:write": "orders:write",
              "quotes:write": "quotes:write",
              "payments:read": "payments:read",
              "payments:write": "payments:write",
              "customers:read": "customers:read",
              "customers:write": "customers:write",
              "staff:read": "staff:read",
              "staff:write": "staff:write",
              "drawer_sessions:read": "drawer_sessions:read",
              "deliveries:read": "deliveries:read",
              "deliveries:write": "deliveries:write",
              "sales:read": "sales:read",
              "events:subscribe": "events:subscribe",
              "events:publish": "events:publish",
              "entitlements:read": "entitlements:read",
              "directory:read": "directory:read",
              "devices:read": "devices:read",
              "devices:write": "devices:write",
              "staff:pin_verify": "staff:pin_verify",
              "staff:roster": "staff:roster",
              "customers:auth": "customers:auth",
              "realtime:publish": "realtime:publish",
              "realtime:subscribe": "realtime:subscribe",
              "notifications:send": "notifications:send",
              "providers:read": "providers:read",
              "providers:write": "providers:write",
              "tips:read": "tips:read",
              "orders:discount": "orders:discount",
              "orders:place_direct": "orders:place_direct",
              "orders:release_unpaid": "orders:release_unpaid",
              "staff:set_pin": "staff:set_pin",
              "devices:pair": "devices:pair"
            }
          }
        }
      }
    }
  }
}
