{
  "openapi": "3.1.0",
  "info": {
    "title": "API di Coffee Marketing Pro",
    "version": "v1",
    "description": "Le API di Coffee Marketing Pro: lo stesso lavoro del backoffice, da programma. Una chiave per azienda, errori in una forma sola, numeri che non perdono centesimi. Stato: beta.",
    "x-status": "beta"
  },
  "servers": [
    {
      "url": "https://api.coffeemarketingpro.com/v1"
    }
  ],
  "tags": [
    {
      "name": "issuer",
      "description": "Dati fiscali dell'azienda"
    },
    {
      "name": "series",
      "description": "Serie di numerazione"
    },
    {
      "name": "parties",
      "description": "Clienti e fornitori dei documenti"
    },
    {
      "name": "documents",
      "description": "Documenti: fatture, note di credito, preventivi, ordini, DDT"
    },
    {
      "name": "articles",
      "description": "Articoli del catalogo: prezzo, stato, varianti e scelte"
    },
    {
      "name": "categories",
      "description": "Categorie del catalogo"
    },
    {
      "name": "catalog",
      "description": "Catalogo pronto per il primo articolo"
    },
    {
      "name": "allergens",
      "description": "Allergeni che un articolo può dichiarare"
    },
    {
      "name": "till_catalog",
      "description": "Catalogo arrivato alla cassa e sue versioni"
    },
    {
      "name": "price_lists",
      "description": "Listini e prezzi per modo di vendita"
    },
    {
      "name": "departments",
      "description": "Reparti con IVA e numeri della stampante"
    },
    {
      "name": "vat_rates",
      "description": "Aliquote IVA"
    },
    {
      "name": "payment_methods",
      "description": "Metodi di pagamento della cassa"
    },
    {
      "name": "sites",
      "description": "Sedi del locale"
    },
    {
      "name": "receipts",
      "description": "Scontrini, annulli e resi con righe e pagamenti"
    },
    {
      "name": "cash_moves",
      "description": "Movimenti di cassa"
    },
    {
      "name": "day",
      "description": "Giornata di cassa aperta"
    },
    {
      "name": "closings",
      "description": "Chiusure con lo stato in contabilità"
    },
    {
      "name": "export",
      "description": "Export del periodo in Excel e CSV"
    },
    {
      "name": "invoice_requests",
      "description": "Richieste di fattura dal banco"
    },
    {
      "name": "club_postings",
      "description": "Passaggi dei punti al Club"
    },
    {
      "name": "overview",
      "description": "Panoramica degli incassi"
    },
    {
      "name": "giftcards",
      "description": "Carte regalo: saldo, movimenti, resoconto"
    },
    {
      "name": "floor",
      "description": "Pianta della sala"
    },
    {
      "name": "tables",
      "description": "Tavoli: righe, comande, spostamenti, annulli"
    },
    {
      "name": "table_events",
      "description": "Storico dei tavoli"
    },
    {
      "name": "table_settings",
      "description": "Impostazioni della sala"
    },
    {
      "name": "table_commands",
      "description": "Scritture in coda al punto d'appoggio del locale"
    },
    {
      "name": "till_people",
      "description": "Chi lavora alla cassa"
    },
    {
      "name": "till_devices",
      "description": "iPad della cassa e loro sede"
    },
    {
      "name": "till_features",
      "description": "Funzioni attive della cassa e licenza"
    }
  ],
  "paths": {
    "/issuer": {
      "get": {
        "operationId": "issuer_get",
        "summary": "Leggi i dati fiscali dell'azienda",
        "tags": [
          "issuer"
        ],
        "description": "Risponde 404 finché l'azienda non li ha inseriti.",
        "x-door": "documents.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issuer"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "put": {
        "operationId": "issuer_put",
        "summary": "Salva i dati fiscali dell'azienda",
        "tags": [
          "issuer"
        ],
        "x-door": "documents.edit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssuerIn"
              },
              "example": {
                "country": "IT",
                "legal_name": "Bar Esempio Srl",
                "vat_country": "IT",
                "vat_number": "01234567897",
                "street": "Via Roma",
                "street_number": "1",
                "postcode": "16121",
                "city": "Genova",
                "province": "GE",
                "it": {
                  "regime": "RF01"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issuer"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/series": {
      "get": {
        "operationId": "series_list",
        "summary": "Elenca le serie di numerazione",
        "tags": [
          "series"
        ],
        "x-door": "documents.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Series"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "series_create",
        "summary": "Crea una serie di numerazione",
        "tags": [
          "series"
        ],
        "x-door": "documents.edit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeriesIn"
              },
              "example": {
                "code": "FT",
                "name": "Fatture",
                "kinds": [
                  "invoice",
                  "credit_note"
                ],
                "number_format": "{n}"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/parties": {
      "get": {
        "operationId": "party_list",
        "summary": "Cerca clienti e fornitori",
        "tags": [
          "parties"
        ],
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Cerca nel nome, o una partita IVA o un codice fiscale esatti. Si usano i primi 80 caratteri; al massimo 50 risultati."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartySummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "party_create",
        "summary": "Crea un cliente o un fornitore",
        "tags": [
          "parties"
        ],
        "x-door": "documents.edit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartyIn"
              },
              "example": {
                "kind": "company",
                "name": "Hotel Esempio Spa",
                "vat_country": "IT",
                "vat_number": "09876543217",
                "street": "Via XX Settembre",
                "street_number": "5",
                "postcode": "16121",
                "city": "Genova",
                "province": "GE",
                "is_customer": true,
                "it": {
                  "sdi_code": "ABC1234"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Party"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/parties/{pid}": {
      "get": {
        "operationId": "party_get",
        "summary": "Leggi un soggetto",
        "tags": [
          "parties"
        ],
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il soggetto."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Party"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "put": {
        "operationId": "party_put",
        "summary": "Cambia un soggetto",
        "tags": [
          "parties"
        ],
        "description": "Si cambiano solo i campi che mandi; gli altri restano come sono.",
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il soggetto."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartyPatch"
              },
              "example": {
                "email": "amministrazione@hotelesempio.it"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Party"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents": {
      "post": {
        "operationId": "document_create",
        "summary": "Crea un documento",
        "tags": [
          "documents"
        ],
        "description": "Nasce in bozza; con `lines` e `issue: true` nasce intero ed emesso in una chiamata sola. Con `Idempotency-Key` una ripetizione non crea un secondo documento.",
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentIn"
              },
              "example": {
                "kind": "invoice",
                "party_id": "<id del soggetto>",
                "series_id": "<id della serie>",
                "lines": [
                  {
                    "description": "Caffè in grani 1 kg",
                    "quantity": 2,
                    "unit_price": "18.00",
                    "tax_rate": 22
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `receipt_taken`, `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "receipt_taken",
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "get": {
        "operationId": "document_list",
        "summary": "Elenca i documenti",
        "tags": [
          "documents"
        ],
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "quote",
                    "proforma",
                    "order",
                    "delivery_note",
                    "invoice",
                    "credit_note",
                    "receipt",
                    "return",
                    "purchase_order",
                    "purchase_invoice",
                    "self_invoice"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "quote preventivo, proforma fattura proforma, order ordine, delivery_note DDT, invoice fattura, credit_note nota di credito, receipt scontrino, return reso, purchase_order ordine al fornitore, purchase_invoice fattura d'acquisto, self_invoice autofattura."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "draft",
                    "issued",
                    "rejected",
                    "discarded"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "draft bozza, issued emesso, rejected scartato dallo SDI, discarded bozza scartata."
          },
          {
            "name": "party_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "I documenti di un soggetto."
          },
          {
            "name": "sdi_state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "queued",
                    "submitted",
                    "failed",
                    "sent",
                    "delivered",
                    "not_delivered",
                    "rejected",
                    "accepted",
                    "refused",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Lo stato dell'ultimo invio allo SDI."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Cerca nel numero e nel nome del soggetto."
          },
          {
            "name": "receipt_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Per cercare la fattura di uno scontrino: insieme a receipt_number e receipt_date."
          },
          {
            "name": "receipt_number",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "receipt_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti, da 1 a 100 (se manca, 50). I più recenti per primi."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti saltarne, per leggere l'elenco a pagine (se manca, 0)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentSummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}": {
      "get": {
        "operationId": "document_get",
        "summary": "Leggi un documento",
        "tags": [
          "documents"
        ],
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "delete": {
        "operationId": "document_discard",
        "summary": "Scarta una bozza",
        "tags": [
          "documents"
        ],
        "description": "Solo una bozza: resta leggibile con lo stato `discarded`. Un documento emesso si corregge con una nota di credito.",
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "put": {
        "operationId": "document_rewrite",
        "summary": "Riscrivi una bozza",
        "tags": [
          "documents"
        ],
        "description": "Solo una bozza. Quello che mandi sostituisce quello che c'era: il soggetto, le note, se i prezzi sono IVA inclusa, oggetto, ordine, termini di pagamento e, se mandi `lines`, tutte le righe. Quello che non mandi resta com'è. O cambia tutto o non cambia niente.",
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La bozza."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/transmissions": {
      "get": {
        "operationId": "document_transmissions",
        "summary": "Gli invii di un documento allo SDI",
        "tags": [
          "documents"
        ],
        "description": "Un invio per ogni volta che il file è partito, il più recente per primo, con quello che il canale ha risposto (anche i motivi di uno scarto). Il file non c'è: si scarica da `/xml`.",
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Transmission"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/lines": {
      "post": {
        "operationId": "line_add",
        "summary": "Aggiungi una riga a una bozza",
        "tags": [
          "documents"
        ],
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La bozza."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LineIn"
              },
              "example": {
                "description": "Cornetto",
                "quantity": 10,
                "unit_price": "1.20",
                "tax_rate": 10
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/issue": {
      "post": {
        "operationId": "document_issue",
        "summary": "Emetti un documento",
        "tags": [
          "documents"
        ],
        "description": "Gli dà il numero e la data. Una fattura italiana parte verso lo SDI: costa un credito. Ripetuta su un documento già emesso, risponde lo stesso documento.",
        "x-door": "documents.issue",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La bozza."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/derive": {
      "post": {
        "operationId": "document_derive",
        "summary": "Crea un documento da questo",
        "tags": [
          "documents"
        ],
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento di partenza."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeriveIn"
              },
              "example": {
                "kind": "invoice"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/credit-note": {
      "post": {
        "operationId": "document_credit_note",
        "summary": "Storna una fattura con una nota di credito",
        "tags": [
          "documents"
        ],
        "x-door": "documents.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La fattura emessa."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditNoteIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `document`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "document",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/pdf": {
      "get": {
        "operationId": "document_pdf",
        "summary": "Scarica la copia di cortesia in PDF",
        "tags": [
          "documents"
        ],
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento emesso."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/pdf"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/documents/{did}/xml": {
      "get": {
        "operationId": "document_xml",
        "summary": "Scarica il file FatturaPA",
        "tags": [
          "documents"
        ],
        "description": "Il file mandato allo SDI; se il documento non è passato dallo SDI, il FatturaPA del documento emesso, per chi lo invia con un suo canale.",
        "x-door": "documents.read",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il documento emesso."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/xml"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `document`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "document"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles": {
      "get": {
        "operationId": "article_list",
        "summary": "Elenca gli articoli",
        "tags": [
          "articles"
        ],
        "description": "Con prezzo al banco e stato, come nel Catalogo del gestionale. In ordine di identificativo, una pagina alla volta: `next` dice da dove riprendere.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Cerca nel nome e nel codice."
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Gli articoli di una categoria."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "on_sale",
                    "suspended",
                    "off_menu"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArticleSummaryPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "article_create",
        "summary": "Crea un articolo",
        "tags": [
          "articles"
        ],
        "description": "Con la sua variante e, se mandi `price_cents`, il prezzo nel listino di tutti i giorni. Nasce sospeso se non dici `on_sale`. Un nome già usato risponde 409 `duplicate` con l'`id` dell'articolo che c'è. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleIn"
              },
              "example": {
                "name": "Cappuccino d'avena",
                "department_id": "<id del reparto>",
                "category_id": "<id della categoria>",
                "price_cents": 180,
                "status": "on_sale"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/{aid}": {
      "get": {
        "operationId": "article_get",
        "summary": "Leggi la scheda di un articolo",
        "tags": [
          "articles"
        ],
        "description": "Varianti coi prezzi di ogni listino aperto oggi, scelte con i supplementi, reparto e IVA.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "L'articolo."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "patch": {
        "operationId": "article_patch",
        "summary": "Cambia un articolo",
        "tags": [
          "articles"
        ],
        "description": "Nome, nome sullo scontrino, codice, categoria, reparto, descrizione e stato: solo quelli che mandi. Cambiare reparto cambia l'IVA delle prossime vendite, mai delle passate.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "L'articolo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticlePatch"
              },
              "example": {
                "status": "suspended"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/{aid}/price": {
      "put": {
        "operationId": "article_price",
        "summary": "Cambia il prezzo di un articolo",
        "tags": [
          "articles"
        ],
        "description": "Il prezzo al banco nel listino di tutti i giorni, da adesso: il prezzo di prima resta nella storia. Per un articolo con più varianti, o per un altro listino, `PUT /v1/price_lists/{id}/prices/{variant_id}`.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "L'articolo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceIn"
              },
              "example": {
                "price_cents": 150
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/status": {
      "post": {
        "operationId": "articles_status",
        "summary": "Cambia lo stato di più articoli",
        "tags": [
          "articles"
        ],
        "description": "Da 1 a 1.000 articoli in una chiamata, tutti o nessuno.",
        "x-door": "catalog.edit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticlesStatusIn"
              },
              "example": {
                "article_ids": [
                  "<id>",
                  "<id>"
                ],
                "status": "suspended"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Changed"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/category": {
      "post": {
        "operationId": "articles_category",
        "summary": "Sposta più articoli in una categoria",
        "tags": [
          "articles"
        ],
        "description": "Da 1 a 1.000 articoli in una chiamata, tutti o nessuno.",
        "x-door": "catalog.edit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticlesCategoryIn"
              },
              "example": {
                "article_ids": [
                  "<id>",
                  "<id>"
                ],
                "category_id": "<id della categoria>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Changed"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/{aid}/variants": {
      "post": {
        "operationId": "variant_set",
        "summary": "Dai a un articolo una variante per nome",
        "tags": [
          "articles"
        ],
        "description": "Risponde con la variante che ha quel nome: quella che l'articolo ha già; o la sua unica variante senza nome, che prende il nome e tiene i prezzi; o una nuova, ultima nell'ordine. Ripetere la stessa richiesta non ne crea una seconda. Il prezzo si mette poi nel listino: `PUT /v1/price_lists/{id}/prices/{variant_id}`.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "L'articolo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantIn"
              },
              "example": {
                "name": "Grande"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Variant"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/articles/{aid}/allergens": {
      "put": {
        "operationId": "article_allergens",
        "summary": "Dichiara gli allergeni di un articolo",
        "tags": [
          "articles"
        ],
        "description": "Per un articolo senza ricetta (con la ricetta si sommano a quelli dei suoi ingredienti): la lista intera dei codici di `GET /v1/allergens`. Sul menu uno specifico porta con sé il suo principale (il grano anche il glutine).",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "L'articolo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllergensIn"
              },
              "example": {
                "allergens": [
                  "milk",
                  "gluten"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Article"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/categories": {
      "get": {
        "operationId": "category_list",
        "summary": "Elenca le categorie",
        "tags": [
          "categories"
        ],
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "category_create",
        "summary": "Crea una categoria",
        "tags": [
          "categories"
        ],
        "description": "Ultima nell'ordine della cassa. Un nome già usato risponde 409 `duplicate` con l'`id` della categoria che c'è. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryIn"
              },
              "example": {
                "name": "Brunch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/categories/{cid}": {
      "patch": {
        "operationId": "category_rename",
        "summary": "Rinomina una categoria",
        "tags": [
          "categories"
        ],
        "description": "Il codice resta: è come la conoscono la cassa e gli import.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La categoria."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryIn"
              },
              "example": {
                "name": "Colazioni"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "delete": {
        "operationId": "category_retire",
        "summary": "Ritira una categoria",
        "tags": [
          "categories"
        ],
        "description": "Solo quando nessun articolo in vendita o sospeso la usa più, e non ne contiene altre.",
        "x-door": "catalog.edit",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La categoria."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Retired"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/catalog/start": {
      "post": {
        "operationId": "catalog_start",
        "summary": "Prepara il catalogo per il primo articolo",
        "tags": [
          "catalog"
        ],
        "description": "Per un'azienda appena nata, che non ha ancora né listino né reparti: crea il listino di tutti i giorni («Listino base») e un reparto («Somministrazione», IVA al 10%, cibi e bevande serviti al tavolo o al banco). Dove ci sono già non tocca niente, quindi si può chiamare ogni volta. Chi usa la cassa controlla poi i reparti, come ogni azienda.",
        "x-door": "catalog.edit",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogStarted"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/allergens": {
      "get": {
        "operationId": "allergen_list",
        "summary": "Elenca gli allergeni",
        "tags": [
          "allergens"
        ],
        "description": "Quelli che un articolo può dichiarare, con il codice da mandare a `PUT /v1/articles/{id}/allergens`.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[a-z_]{2,20}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllergenPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_catalog": {
      "get": {
        "operationId": "till_catalog_get",
        "summary": "Leggi il catalogo arrivato alla cassa",
        "tags": [
          "till_catalog"
        ],
        "description": "L'ultima versione pubblicata agli iPad, così come la leggono. Risponde 404 finché non ne è arrivata nessuna.",
        "x-door": "catalog.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillCatalog"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_catalog/versions": {
      "get": {
        "operationId": "till_catalog_versions",
        "summary": "Elenca le versioni del catalogo della cassa",
        "tags": [
          "till_catalog"
        ],
        "description": "Dalla più recente.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "pattern": "^[1-9][0-9]{0,17}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillCatalogVersionPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists": {
      "get": {
        "operationId": "price_list_list",
        "summary": "Elenca i listini",
        "tags": [
          "price_lists"
        ],
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceListPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "price_list_create",
        "summary": "Crea un listino",
        "tags": [
          "price_lists"
        ],
        "description": "Con un nome; i prezzi che non scrivi li prende dal listino a cui si appoggia, altrimenti da quello di tutti i giorni. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceListIn"
              },
              "example": {
                "name": "Asporto",
                "at_till": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists/{lid}": {
      "get": {
        "operationId": "price_list_get",
        "summary": "Leggi un listino",
        "tags": [
          "price_lists"
        ],
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "patch": {
        "operationId": "price_list_patch",
        "summary": "Cambia un listino",
        "tags": [
          "price_lists"
        ],
        "description": "Nome, listino di appoggio, alla cassa, listino della sala, listino di tutti i giorni: solo quelli che mandi.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceListPatch"
              },
              "example": {
                "at_till": true,
                "room_default": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "delete": {
        "operationId": "price_list_retire",
        "summary": "Ritira un listino",
        "tags": [
          "price_lists"
        ],
        "description": "Non si usa più; i suoi prezzi restano nella storia. Il listino di tutti i giorni non si ritira.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Retired"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists/{lid}/prices": {
      "get": {
        "operationId": "price_list_prices",
        "summary": "Leggi i prezzi di un listino per modo di vendita",
        "tags": [
          "price_lists"
        ],
        "description": "Una riga per variante in vendita, come la griglia dei Listini del gestionale: il prezzo scritto nel listino e quello che vale al banco, al tavolo, da asporto e a domicilio.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Cerca nel nome e nel codice dell'articolo."
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Le righe di una categoria."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRowPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists/{lid}/duplicate": {
      "post": {
        "operationId": "price_list_duplicate",
        "summary": "Duplica un listino",
        "tags": [
          "price_lists"
        ],
        "description": "Una copia coi prezzi che il listino fa oggi, scritti come suoi; non si appoggia a niente e non è alla cassa. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino da copiare."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateIn"
              },
              "example": {
                "name": "Asporto estate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists/{lid}/prices/{vid}": {
      "put": {
        "operationId": "price_list_cell",
        "summary": "Cambia il prezzo di una variante in un listino",
        "tags": [
          "price_lists"
        ],
        "description": "Da adesso; il prezzo di prima resta nella storia. `null` toglie il prezzo di questo listino.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          },
          {
            "name": "vid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La variante (vedi le `variants` della scheda articolo)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CellIn"
              },
              "example": {
                "price_cents": 220
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRow"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/price_lists/{lid}/reprice": {
      "post": {
        "operationId": "price_list_reprice",
        "summary": "Cambia molti prezzi di un listino per percentuale",
        "tags": [
          "price_lists"
        ],
        "description": "Prima chiedi senza `apply` e guardi cosa cambierebbe; poi mandi la stessa chiamata con `apply: true`. Applicata con `Idempotency-Key`, una ripetizione risponde come la prima e non aumenta i prezzi due volte.",
        "x-door": "pricelists.edit",
        "parameters": [
          {
            "name": "lid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il listino."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepriceIn"
              },
              "example": {
                "percent": "5",
                "round_to_cents": 10,
                "apply": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reprice"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/departments": {
      "get": {
        "operationId": "department_list",
        "summary": "Elenca i reparti",
        "tags": [
          "departments"
        ],
        "description": "Con l'aliquota IVA e il numero di reparto sulla stampante di ogni sede.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepartmentPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "department_create",
        "summary": "Crea un reparto",
        "tags": [
          "departments"
        ],
        "description": "Con l'aliquota IVA; il numero sulla stampante di ogni sede si dà dopo. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "departments.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepartmentIn"
              },
              "example": {
                "name": "Bevande 10%",
                "vat_rate_id": "<id dell'aliquota>"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Department"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Department"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/departments/{did}": {
      "patch": {
        "operationId": "department_patch",
        "summary": "Cambia un reparto",
        "tags": [
          "departments"
        ],
        "x-door": "departments.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il reparto."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepartmentPatch"
              },
              "example": {
                "ateco": "56.30"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Department"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "delete": {
        "operationId": "department_retire",
        "summary": "Ritira un reparto",
        "tags": [
          "departments"
        ],
        "description": "Solo quando nessun articolo in vendita o sospeso lo usa più.",
        "x-door": "departments.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il reparto."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Retired"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/departments/{did}/printers": {
      "put": {
        "operationId": "department_printer",
        "summary": "Imposta il numero del reparto sulla stampante fiscale",
        "tags": [
          "departments"
        ],
        "description": "Per una sede. Un numero già impostato si cambia solo con `confirm: true`: uno sbagliato manda le vendite al reparto fiscale sbagliato.",
        "x-door": "departments.edit",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il reparto."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterIn"
              },
              "example": {
                "site": 1,
                "number": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Department"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `confirm`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "confirm"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/vat_rates": {
      "get": {
        "operationId": "vat_rate_list",
        "summary": "Elenca le aliquote IVA",
        "tags": [
          "vat_rates"
        ],
        "description": "Quelle valide oggi, che un reparto può prendere.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatRatePage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/payment_methods": {
      "get": {
        "operationId": "payment_method_list",
        "summary": "Elenca i metodi di pagamento",
        "tags": [
          "payment_methods"
        ],
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "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": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethodPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "post": {
        "operationId": "method_create",
        "summary": "Crea un metodo di pagamento",
        "tags": [
          "payment_methods"
        ],
        "description": "Codice e tipo fiscale si scelgono qui e poi non cambiano. Con `Idempotency-Key` una ripetizione risponde con quello creato la prima volta, senza farne un secondo.",
        "x-door": "payment_methods.edit",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/\\-]{8,120}$"
            },
            "description": "Una chiave tua, da 8 a 120 caratteri, diversa per ogni operazione: se la risposta si perde e ripeti la chiamata con la stessa chiave, ricevi il risultato della prima (200) invece di crearne un secondo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodIn"
              },
              "example": {
                "name": "Satispay",
                "fiscal_type": "electronic"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            }
          },
          "200": {
            "description": "La stessa Idempotency-Key era già servita: il risultato della prima chiamata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `duplicate`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "duplicate"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`, `idempotency`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused",
              "idempotency"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/payment_methods/{mid}": {
      "patch": {
        "operationId": "method_patch",
        "summary": "Cambia un metodo di pagamento",
        "tags": [
          "payment_methods"
        ],
        "x-door": "payment_methods.edit",
        "parameters": [
          {
            "name": "mid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il metodo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodPatch"
              },
              "example": {
                "sort": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "delete": {
        "operationId": "method_retire",
        "summary": "Ritira un metodo di pagamento",
        "tags": [
          "payment_methods"
        ],
        "description": "L'ultimo metodo dei contanti non si ritira: la cassa ne ha bisogno.",
        "x-door": "payment_methods.edit",
        "parameters": [
          {
            "name": "mid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il metodo."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Retired"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "422": {
            "description": "Codici: `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/payment_methods/{mid}/printers": {
      "put": {
        "operationId": "method_printer",
        "summary": "Imposta il numero del pagamento sulla stampante fiscale",
        "tags": [
          "payment_methods"
        ],
        "description": "Per una sede. Un numero già impostato si cambia solo con `confirm: true`.",
        "x-door": "payment_methods.edit",
        "parameters": [
          {
            "name": "mid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il metodo."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterIn"
              },
              "example": {
                "site": 1,
                "number": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `confirm`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "confirm"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `refused`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "refused"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/sites": {
      "get": {
        "operationId": "site_list",
        "summary": "Elenca le sedi del locale",
        "tags": [
          "sites"
        ],
        "description": "Le sedi aperte dell'azienda.",
        "x-door": "catalog.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                  "pattern": "^[1-9][0-9]{0,17}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SitePage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/receipts": {
      "get": {
        "operationId": "receipt_list",
        "summary": "Elenca scontrini, annulli e resi",
        "tags": [
          "receipts"
        ],
        "description": "Di tutti gli iPad del locale, con i pagamenti. In ordine di tempo, dal più vecchio: chi tiene `next` legge ogni scontrino una volta, anche quelli che arrivano dopo. Uno scontrino compare qui entro un minuto da quando l'iPad lo manda.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Dal giorno (compreso), nell'ora del locale."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Fino al giorno (compreso), nell'ora del locale."
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "sale",
                    "void",
                    "refund"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "sale vendita, void annullo, refund reso."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "printed",
                    "pending",
                    "uncertain",
                    "failed",
                    "not_printed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_.\\-]{1,60}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il codice di un iPad: solo i suoi."
          },
          {
            "name": "z_number",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 1000000,
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il numero della chiusura fiscale (Z)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillReceiptSummaryPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/receipts/{rid}": {
      "get": {
        "operationId": "receipt_get",
        "summary": "Leggi uno scontrino",
        "tags": [
          "receipts"
        ],
        "description": "Con le righe, i pagamenti, gli annulli e i resi che lo correggono, le richieste di fattura e la tessera Club.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Lo scontrino, l'annullo o il reso (il suo `id`)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillReceipt"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/cash_moves": {
      "get": {
        "operationId": "cash_move_list",
        "summary": "Elenca i movimenti di cassa",
        "tags": [
          "cash_moves"
        ],
        "description": "Cassetto aperto, versamenti, prelievi, fondo dichiarato, letture X e ristampe, di tutti gli iPad, in ordine di tempo.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Dal giorno (compreso), nell'ora del locale."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Fino al giorno (compreso), nell'ora del locale."
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "drawer",
                    "cash_in",
                    "cash_out",
                    "float",
                    "x_reading",
                    "reprint"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "drawer cassetto aperto senza vendita, cash_in versamento, cash_out prelievo, float fondo cassa dichiarato, x_reading lettura X, reprint ristampa di una copia."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_.\\-]{1,60}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il codice di un iPad: solo i suoi."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashMovePage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/day": {
      "get": {
        "operationId": "day_get",
        "summary": "Leggi la giornata di cassa aperta",
        "tags": [
          "day"
        ],
        "description": "Dalla chiusura prima a adesso, di tutti gli iPad: quello che il cassetto deve contenere, per metodo, per aliquota e per persona. Sono i numeri della schermata di chiusura dell'iPad.",
        "x-door": "sales.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashDay"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/closings": {
      "get": {
        "operationId": "closing_list",
        "summary": "Elenca le chiusure",
        "tags": [
          "closings"
        ],
        "description": "Dalla più recente, con il conteggio, la differenza e lo stato della registrazione in contabilità.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosingPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/closings/{cid}": {
      "get": {
        "operationId": "closing_get",
        "summary": "Leggi una chiusura",
        "tags": [
          "closings"
        ],
        "description": "Con la giornata di cassa che ha chiuso e la giornata fiscale della sua Z.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La chiusura (il suo `id`)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosingDetail"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/export/xlsx": {
      "get": {
        "operationId": "export_xlsx",
        "summary": "Scarica il periodo in Excel",
        "tags": [
          "export"
        ],
        "description": "Documenti, righe, pagamenti, movimenti di cassa, chiusure e incassi per aliquota del periodo: lo stesso file che l'iPad dà al commercialista. Al massimo 31 giorni per chiamata: per un anno, un mese alla volta.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "Il primo giorno, AAAA-MM-GG."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "L'ultimo giorno compreso, AAAA-MM-GG; al massimo 400 giorni dopo `from`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/export/csv": {
      "get": {
        "operationId": "export_csv",
        "summary": "Scarica il periodo in CSV",
        "tags": [
          "export"
        ],
        "description": "Documenti, righe, pagamenti, movimenti di cassa, chiusure e incassi per aliquota del periodo: lo stesso file che l'iPad dà al commercialista. Al massimo 31 giorni per chiamata: per un anno, un mese alla volta. Un file CSV per foglio, in uno zip.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "Il primo giorno, AAAA-MM-GG."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "L'ultimo giorno compreso, AAAA-MM-GG; al massimo 400 giorni dopo `from`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/zip"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/invoice_requests": {
      "get": {
        "operationId": "invoice_request_list",
        "summary": "Elenca le richieste di fattura dal banco",
        "tags": [
          "invoice_requests"
        ],
        "description": "Quale scontrino, quale cliente, a che punto è il documento. In ordine di tempo.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "queued",
                    "issued",
                    "error",
                    "withdrawn"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Solo in questo stato."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceRequestRowPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/club_postings": {
      "get": {
        "operationId": "club_posting_list",
        "summary": "Elenca i passaggi dei punti al Club",
        "tags": [
          "club_postings"
        ],
        "description": "Per ogni scontrino con la tessera, e per gli annulli e i resi che lo correggono, cosa ha risposto il Club. La tessera si legge sullo scontrino.",
        "x-door": "sales.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubPostingRowPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/overview": {
      "get": {
        "operationId": "overview_get",
        "summary": "Leggi la Panoramica",
        "tags": [
          "overview"
        ],
        "description": "Gli incassi di oggi e di ieri alla stessa ora, ora per ora, come si è pagato e i giorni senza chiusura: i numeri della Panoramica del gestionale.",
        "x-door": "sales.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overview"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards": {
      "get": {
        "operationId": "card_list",
        "summary": "Elenca le carte regalo",
        "tags": [
          "giftcards"
        ],
        "description": "Con stato e saldo, in ordine di identificativo. Il codice non esce mai: solo le ultime quattro cifre.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pending",
                    "active",
                    "exhausted",
                    "expired",
                    "blocked",
                    "voided"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "pending in attesa della stampa, active attiva, exhausted finita, expired scaduta, blocked bloccata, voided annullata."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 60,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Cerca nell'intestatario o fra le ultime quattro cifre del codice (P24, 08/11/2026)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardPage"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/lookup": {
      "get": {
        "operationId": "card_lookup",
        "summary": "Trova una carta dal suo codice",
        "tags": [
          "giftcards"
        ],
        "description": "Il codice va nell'intestazione `X-Giftcard-Code`, mai nell'indirizzo (gli indirizzi finiscono nei registri, le intestazioni no). Con i movimenti.",
        "x-door": "giftcards.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDetail"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/{card_id}": {
      "get": {
        "operationId": "card_get",
        "summary": "Leggi una carta regalo",
        "tags": [
          "giftcards"
        ],
        "description": "Stato, saldo, quanto si può spendere adesso e tutti i movimenti.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La carta (il suo `id`)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardDetail"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/{card_id}/print": {
      "get": {
        "operationId": "card_print",
        "summary": "Ristampa una carta regalo",
        "tags": [
          "giftcards"
        ],
        "description": "Il codice di UNA carta, per farne il QR, il PDF e il PNG (da mandare al cliente o stampare). Porta a parte, `giftcards.print`, mai accesa di base: il codice è il denaro della carta. Solo una carta attiva, mai una che il cliente ha aggiunto nell'app (il suo codice vive lì). Il QR contiene il codice così com'è.",
        "x-door": "giftcards.print",
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "La carta (il suo `id`)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardPrint"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`, `in_app`, `not_printable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off",
              "in_app",
              "not_printable"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/report": {
      "get": {
        "operationId": "card_report",
        "summary": "Leggi il resoconto delle carte",
        "tags": [
          "giftcards"
        ],
        "description": "Per canale: vendute, annullate, spese, riaccreditate, scadute, i saldi all'inizio e alla fine del periodo, e le carte con saldo alla fine.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "Il primo giorno, AAAA-MM-GG."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "L'ultimo giorno compreso, AAAA-MM-GG; al massimo 400 giorni dopo `from`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardReport"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/ledger": {
      "get": {
        "operationId": "card_ledger",
        "summary": "Leggi il registro delle carte per il commercialista",
        "tags": [
          "giftcards"
        ],
        "description": "Il debito per carte da usare all'inizio e alla fine del periodo (conto 253100), le vendute, le usate col loro bonus, le scadute (sopravvenienza, conto 323000), le rimborsate e la quadratura. Ogni voce in pagato e in valore: il pagato è quello che conta in contabilità.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}(-(0[1-9]|1[0-2])|-Q[1-4])?$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Un mese (AAAA-MM), un trimestre (AAAA-Qn) o un anno (AAAA). In alternativa `from` e `to`, mai insieme."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il primo giorno, AAAA-MM-GG, quando manca `period`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "L'ultimo giorno compreso, AAAA-MM-GG, quando manca `period`; al massimo 400 giorni dopo `from`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardLedger"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/open_cards": {
      "get": {
        "operationId": "card_open",
        "summary": "Elenca le carte con saldo a una data",
        "tags": [
          "giftcards"
        ],
        "description": "Le carte con saldo alla fine del giorno, carta per carta, in pagato e in valore: la loro somma è il debito di quel giorno. Il codice non esce mai: solo le ultime quattro cifre.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "Il giorno: le carte con saldo alla fine di quel giorno."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenCards"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/giftcards/anomalies": {
      "get": {
        "operationId": "card_anomalies",
        "summary": "Leggi le anomalie delle carte",
        "tags": [
          "giftcards"
        ],
        "description": "Vendute e annullate lo stesso giorno, spese entro cinque minuti dalla vendita, due scontrini nello stesso minuto, i riaccrediti.",
        "x-door": "giftcards.read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "Il primo giorno, AAAA-MM-GG."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "description": "L'ultimo giorno compreso, AAAA-MM-GG; al massimo 400 giorni dopo `from`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardAnomalies"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `giftcards_off`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "giftcards_off"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/floor": {
      "get": {
        "operationId": "room_floor",
        "summary": "Leggi la pianta della sala",
        "tags": [
          "floor"
        ],
        "description": "Le sale e i loro tavoli, come li vedono gli iPad, e dove lavora la sala adesso.",
        "x-door": "tables.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Floor"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "floor_missing"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "put": {
        "operationId": "room_floor_put",
        "summary": "Pubblica la pianta della sala",
        "tags": [
          "floor"
        ],
        "description": "Sostituisce la pianta: sale e tavoli. Un tavolo aperto non può sparire. Gli iPad la ricevono al prossimo aggiornamento; il punto d'appoggio entro un minuto. Per l'asporto basta una sala «Ritiro» con i suoi tavoli.",
        "x-door": "tables.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPublished"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "409": {
            "description": "Codici: `tables_still_open`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "tables_still_open"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables": {
      "get": {
        "operationId": "room_tables",
        "summary": "Elenca i tavoli",
        "tags": [
          "tables"
        ],
        "description": "I tavoli occupati con le righe mandate, il conto e chi le ha mandate; con `all=true` anche i liberi. Con il punto d'appoggio acceso nel locale è la copia del server, qualche secondo indietro al massimo (`room`).",
        "x-door": "tables.read",
        "parameters": [
          {
            "name": "all",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Anche i tavoli liberi (di base solo quelli occupati)."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tables"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "floor_missing"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}": {
      "get": {
        "operationId": "room_table",
        "summary": "Leggi un tavolo",
        "tags": [
          "tables"
        ],
        "x-door": "tables.read",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Table"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/send": {
      "post": {
        "operationId": "room_send",
        "summary": "Manda righe a un tavolo",
        "tags": [
          "tables"
        ],
        "description": "Come il cameriere che manda la comanda: le righe vanno sul tavolo, che si apre se era libero, e la comanda esce al bar o in cucina. Prezzo, reparto, IVA e postazione li prende la cassa dal suo catalogo, sul listino del tavolo. Ogni riga ha un `id` scelto da chi chiama: rimandarla non la ripete. Senza il punto d'appoggio passano solo le righe già servite (`no_comanda`). Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendIn"
              },
              "example": {
                "lines": [
                  {
                    "id": "6f1c1d3e-6a53-4d8e-9a43-5d0b8f4e2a10",
                    "article": "espresso",
                    "qty": 2
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sent"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `catalog_missing`, `venue_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "catalog_missing",
              "venue_unreachable"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `article_unknown`, `option_unknown`, `table_too_many_lines`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "article_unknown",
              "option_unknown",
              "table_too_many_lines"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/move": {
      "post": {
        "operationId": "room_move",
        "summary": "Sposta o unisci un tavolo",
        "tags": [
          "tables"
        ],
        "description": "Tutto il tavolo su un altro, con il suo «Pagato al banco». Su un tavolo occupato solo con `merge`. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Moved"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `table_empty`, `target_table_busy`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "table_empty",
              "target_table_busy"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/prices": {
      "post": {
        "operationId": "room_prices",
        "summary": "Cambia il listino di un tavolo",
        "tags": [
          "tables"
        ],
        "description": "Il conto su un altro listino, o solo alcune righe (ciascuna sul suo). Prezzi e varianti dal catalogo della cassa; nomi, quantità e sconti restano. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PricesIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`, `line_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing",
              "line_not_found"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `table_empty`, `catalog_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "table_empty",
              "catalog_missing"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/bill": {
      "post": {
        "operationId": "room_bill",
        "summary": "Stampa il preconto",
        "tags": [
          "tables"
        ],
        "description": "Il preconto esce alla stampante del bar e il tavolo si vede in chiusura su tutti gli iPad. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `venue_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "venue_unreachable"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/seat": {
      "post": {
        "operationId": "room_seat",
        "summary": "Fai sedere chi ha pagato al banco",
        "tags": [
          "tables"
        ],
        "description": "Il cliente ha pagato al banco e si siede qui: quello che ha pagato diventa un promemoria sul tavolo, mai parte del conto. La comanda di quello che ha pagato la stampa il banco. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeatIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seated"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `table_too_many_orders`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "table_too_many_orders"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/free": {
      "post": {
        "operationId": "room_free",
        "summary": "Libera un tavolo pagato",
        "tags": [
          "tables"
        ],
        "description": "Le persone di un tavolo «Pagato» se ne sono andate. Un tavolo con righe da incassare non si tocca. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `table_unpaid`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "table_unpaid"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/remove": {
      "post": {
        "operationId": "room_remove",
        "summary": "Togli una riga mandata",
        "tags": [
          "tables"
        ],
        "description": "Come il responsabile sull'iPad: la riga, o alcuni pezzi, escono dal tavolo e alla postazione esce lo storno. La porta tables.manage vale come il PIN del responsabile. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.manage",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`, `line_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing",
              "line_not_found"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`, `quantity_over_line`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field",
              "quantity_over_line"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/cancel": {
      "post": {
        "operationId": "room_cancel",
        "summary": "Annulla un tavolo senza scontrino",
        "tags": [
          "tables"
        ],
        "description": "Il tavolo si svuota senza incasso (procedura di emergenza: pagato al banco a linea ferma). Le postazioni ricevono l'avviso di non preparare, salvo `notify` false. Resta nello storico con tutte le righe e la chiave che l'ha fatto. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.manage",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`, `table_empty`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed",
              "table_empty"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/tables/{table_id}/unlock": {
      "post": {
        "operationId": "room_unlock",
        "summary": "Sblocca un tavolo in pagamento",
        "tags": [
          "tables"
        ],
        "description": "Libera un tavolo fermo «in pagamento» su un iPad che non ha finito (spento, caduto). Lo scontrino che quell'iPad stava stampando va controllato sulla carta. Con il punto d'appoggio acceso nel locale la scrittura passa da lui, come per un iPad: se non risponde in otto secondi la risposta è 202 con il comando da rileggere (/table_commands/{id}); un comando che nessuno prende entro un minuto scade e non si fa.",
        "x-door": "tables.manage",
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il tavolo, come nella pianta."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Written"
                }
              }
            }
          },
          "202": {
            "description": "In coda al punto d'appoggio del locale: si rilegge il comando.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `floor_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "floor_missing"
            ]
          },
          "409": {
            "description": "Codici: `table_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_changed"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "423": {
            "description": "Codici: `table_paying`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "table_paying"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`, `hub_syncing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable",
              "hub_syncing"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/table_events": {
      "get": {
        "operationId": "room_events",
        "summary": "Leggi lo storico dei tavoli",
        "tags": [
          "table_events"
        ],
        "description": "Comande, spostamenti, storni, annulli, incassi, nell'ordine in cui arrivano al server, con l'iPad o la chiave che li ha fatti. Chi tiene il `next` legge ogni evento una volta, anche quelli che il punto d'appoggio copia qui più tardi.",
        "x-door": "tables.read",
        "parameters": [
          {
            "name": "table",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "description": "Il tavolo, come nella pianta (`id`).",
                  "pattern": "^[A-Za-z0-9_\\-]{1,40}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[a-z\\-]{1,20}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Quanti per pagina, da 1 a 100 (50 se manca)."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9]{1,18}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "description": "Il `next` della pagina prima: da qui riparte l'elenco."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableEvents"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/table_settings": {
      "get": {
        "operationId": "room_settings",
        "summary": "Leggi le impostazioni della sala",
        "tags": [
          "table_settings"
        ],
        "x-door": "tables.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomSettings"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "put": {
        "operationId": "room_settings_put",
        "summary": "Cambia le impostazioni della sala",
        "tags": [
          "table_settings"
        ],
        "description": "Solo i campi mandati cambiano. Gli iPad le ricevono con i tavoli; il punto d'appoggio entro un minuto.",
        "x-door": "tables.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomSettingsIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomSettings"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/table_commands/{command_id}": {
      "get": {
        "operationId": "room_command",
        "summary": "Rileggi una scrittura in coda",
        "tags": [
          "table_commands"
        ],
        "description": "Una scrittura lasciata al punto d'appoggio del locale (risposta 202): dov'è e, quando è fatta, cosa ha fatto.",
        "x-door": "tables.edit",
        "parameters": [
          {
            "name": "command_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il `command` della risposta 202."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableCommand"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_people": {
      "get": {
        "operationId": "till_people",
        "summary": "Elenca chi lavora alla cassa",
        "tags": [
          "till_people"
        ],
        "description": "Le persone che possono entrare alla cassa del locale, col loro ruolo: le stesse che l'iPad mostra sulla schermata di blocco. Il PIN non esce mai.",
        "x-door": "staff.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillPeople"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_devices": {
      "get": {
        "operationId": "till_devices",
        "summary": "Elenca gli iPad della cassa",
        "tags": [
          "till_devices"
        ],
        "description": "Gli iPad collegati alla cassa, con la loro sede, l'ultimo contatto e le strade fiscali che il locale gli apre. Collegare, bloccare e scollegare un iPad si fa solo dal gestionale.",
        "x-door": "devices.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillDevices"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_devices/{code}": {
      "get": {
        "operationId": "till_device",
        "summary": "Leggi un iPad della cassa",
        "tags": [
          "till_devices"
        ],
        "x-door": "devices.read",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il codice dell'iPad, come in `/v1/till_devices`."
          }
        ],
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillDevice"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `device_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "device_not_found"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      },
      "patch": {
        "operationId": "till_device_rename",
        "summary": "Rinomina un iPad della cassa",
        "tags": [
          "till_devices"
        ],
        "description": "Come il responsabile dall'iPad: cambia il nome, mai il codice. Due iPad collegati non possono chiamarsi uguale. Gli iPad vedono il nome nuovo subito, il punto d'appoggio del locale al suo prossimo allineamento; lo storico dice che è stata la chiave.",
        "x-door": "devices.edit",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Il codice dell'iPad, come in `/v1/till_devices`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceRenameIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillDevice"
                }
              }
            }
          },
          "400": {
            "description": "Codici: `json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "json"
            ]
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "404": {
            "description": "Codici: `not_found`, `device_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "not_found",
              "device_not_found"
            ]
          },
          "409": {
            "description": "Codici: `device_name_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "device_name_taken"
            ]
          },
          "413": {
            "description": "Codici: `too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "too_large"
            ]
          },
          "422": {
            "description": "Codici: `field`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "field"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    },
    "/till_features": {
      "get": {
        "operationId": "till_features",
        "summary": "Leggi le funzioni attive della cassa",
        "tags": [
          "till_features"
        ],
        "description": "Quello che il locale ha acceso alla cassa e la licenza: l'iPad mostra un pulsante solo per quello che funziona.",
        "x-door": "devices.read",
        "responses": {
          "200": {
            "description": "Fatto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TillFeatures"
                }
              }
            }
          },
          "401": {
            "description": "Codici: `key`, `key_revoked`, `key_expired`, `key_owner_gone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "key",
              "key_revoked",
              "key_expired",
              "key_owner_gone"
            ]
          },
          "402": {
            "description": "Codici: `licence`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "licence"
            ]
          },
          "403": {
            "description": "Codici: `permission`, `key_address`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "permission",
              "key_address"
            ]
          },
          "429": {
            "description": "Codici: `rate_limited`, `address_blocked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "rate_limited",
              "address_blocked"
            ]
          },
          "503": {
            "description": "Codici: `api_paused`, `unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "x-error-codes": [
              "api_paused",
              "unavailable"
            ]
          }
        },
        "security": [
          {
            "key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Accounting": {
        "additionalProperties": false,
        "properties": {
          "state": {
            "description": "Lo stato della registrazione in contabilità: posted registrata, skipped non da registrare, blocked ferma finché manca qualcosa (il motivo in `problem`), review da guardare a mano, error la contabilità non ha risposto.",
            "title": "State",
            "type": "string"
          },
          "entry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il nome della registrazione nella contabilità.",
            "title": "Entry"
          },
          "problem": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Problem"
          }
        },
        "required": [
          "state",
          "entry",
          "problem"
        ],
        "title": "Accounting",
        "type": "object"
      },
      "Allergen": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "description": "Il nome in italiano.",
            "title": "Name",
            "type": "string"
          },
          "name_en": {
            "title": "Name En",
            "type": "string"
          },
          "group": {
            "description": "La famiglia sulla pagina del menu: foods, cereals, nuts, seafood, meat, fruit, bees, other.",
            "title": "Group",
            "type": "string"
          },
          "eu14": {
            "description": "Uno dei 14 dell'allegato II del regolamento (UE) 1169/2011.",
            "title": "Eu14",
            "type": "boolean"
          },
          "implies": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'allergene principale che questo porta con sé (il grano è glutine): il menu lo mostra insieme a lui.",
            "title": "Implies"
          }
        },
        "required": [
          "code",
          "name",
          "name_en",
          "group",
          "eu14",
          "implies"
        ],
        "title": "Allergen",
        "type": "object"
      },
      "AllergenPage": {
        "additionalProperties": false,
        "description": "Una pagina di allergeni.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Allergen"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "AllergenPage",
        "type": "object"
      },
      "AllergenQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[a-z_]{2,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          }
        },
        "title": "AllergenQuery",
        "type": "object"
      },
      "AllergensIn": {
        "properties": {
          "allergens": {
            "description": "I codici di `GET /v1/allergens`, la lista intera: quelli che non mandi si tolgono, `[]` li toglie tutti.",
            "items": {
              "pattern": "^[a-z_]{2,20}$",
              "type": "string"
            },
            "maxItems": 100,
            "title": "Allergens",
            "type": "array"
          }
        },
        "required": [
          "allergens"
        ],
        "title": "AllergensIn",
        "type": "object"
      },
      "Amount": {
        "additionalProperties": false,
        "properties": {
          "paid_cents": {
            "description": "Quanto hanno pagato i clienti: è il debito in contabilità (conto 253100).",
            "title": "Paid Cents",
            "type": "integer"
          },
          "value_cents": {
            "description": "Quanto si può spendere: il pagato più il bonus dei tagli.",
            "title": "Value Cents",
            "type": "integer"
          }
        },
        "required": [
          "paid_cents",
          "value_cents"
        ],
        "title": "Amount",
        "type": "object"
      },
      "AmountWithBonus": {
        "additionalProperties": false,
        "properties": {
          "paid_cents": {
            "description": "Quanto hanno pagato i clienti: è il debito in contabilità (conto 253100).",
            "title": "Paid Cents",
            "type": "integer"
          },
          "value_cents": {
            "description": "Quanto si può spendere: il pagato più il bonus dei tagli.",
            "title": "Value Cents",
            "type": "integer"
          },
          "bonus_cents": {
            "description": "Il bonus: il valore meno il pagato.",
            "title": "Bonus Cents",
            "type": "integer"
          }
        },
        "required": [
          "paid_cents",
          "value_cents",
          "bonus_cents"
        ],
        "title": "AmountWithBonus",
        "type": "object"
      },
      "Article": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "receipt_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il nome sullo scontrino, se diverso.",
            "title": "Receipt Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Id"
          },
          "department_id": {
            "format": "uuid",
            "title": "Department Id",
            "type": "string"
          },
          "vat_rate": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Vat Rate",
            "type": "string"
          },
          "status": {
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu.",
            "enum": [
              "on_sale",
              "suspended",
              "off_menu"
            ],
            "title": "Status",
            "type": "string"
          },
          "station": {
            "description": "Dove si prepara: bar o cucina.",
            "enum": [
              "bar",
              "kitchen"
            ],
            "title": "Station",
            "type": "string"
          },
          "allergens": {
            "items": {
              "type": "string"
            },
            "title": "Allergens",
            "type": "array"
          },
          "seasonal": {
            "title": "Seasonal",
            "type": "boolean"
          },
          "season": {
            "anyOf": [
              {
                "enum": [
                  "estate",
                  "inverno"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Season"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/Variant"
            },
            "title": "Variants",
            "type": "array"
          },
          "option_groups": {
            "description": "Le scelte che la cassa chiede vendendolo.",
            "items": {
              "$ref": "#/components/schemas/OptionGroup"
            },
            "title": "Option Groups",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "receipt_name",
          "description",
          "category_id",
          "department_id",
          "vat_rate",
          "status",
          "station",
          "allergens",
          "seasonal",
          "season",
          "created_at",
          "updated_at",
          "variants",
          "option_groups"
        ],
        "title": "Article",
        "type": "object"
      },
      "ArticleIn": {
        "description": "Un articolo nuovo, con la sua variante e, se c'è, il prezzo nel listino di tutti i giorni.",
        "properties": {
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "receipt_name": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il nome sullo scontrino, se diverso.",
            "title": "Receipt Name"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,59}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Se manca, nasce dal nome.",
            "title": "Code"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Category Id"
          },
          "department_id": {
            "description": "Il reparto: dice l'IVA (vedi `/departments`).",
            "format": "uuid",
            "title": "Department Id",
            "type": "string"
          },
          "station": {
            "default": "bar",
            "description": "Dove si prepara: bar o cucina.",
            "enum": [
              "bar",
              "kitchen"
            ],
            "title": "Station",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "status": {
            "default": "suspended",
            "description": "Nasce sospeso se non dici on_sale: così niente arriva alla cassa per sbaglio. In vendita serve il prezzo.",
            "enum": [
              "on_sale",
              "suspended"
            ],
            "title": "Status",
            "type": "string"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro, IVA compresa: da 0 a 100.000 euro.",
                "maximum": 10000000,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Price Cents"
          }
        },
        "required": [
          "name",
          "department_id"
        ],
        "title": "ArticleIn",
        "type": "object"
      },
      "ArticlePatch": {
        "description": "Si cambiano solo i campi che mandi; `null` svuota quelli che si possono svuotare.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "receipt_name": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Receipt Name"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,59}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Code"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Category Id"
          },
          "department_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Department Id"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Description"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "on_sale",
                  "suspended",
                  "off_menu"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu.",
            "title": "Status"
          }
        },
        "title": "ArticlePatch",
        "type": "object"
      },
      "ArticleQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                "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": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "After"
          },
          "q": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Cerca nel nome e nel codice.",
            "title": "Q"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Gli articoli di una categoria.",
            "title": "Category Id"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "on_sale",
                  "suspended",
                  "off_menu"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu.",
            "title": "Status"
          }
        },
        "title": "ArticleQuery",
        "type": "object"
      },
      "ArticleSummary": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "description": "Il codice dell'articolo nell'azienda.",
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Id"
          },
          "department_id": {
            "description": "Il reparto: dice l'IVA.",
            "format": "uuid",
            "title": "Department Id",
            "type": "string"
          },
          "vat_rate": {
            "description": "L'aliquota IVA del reparto, in percento.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Vat Rate",
            "type": "string"
          },
          "status": {
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu.",
            "enum": [
              "on_sale",
              "suspended",
              "off_menu"
            ],
            "title": "Status",
            "type": "string"
          },
          "variants": {
            "description": "Quante varianti si vendono.",
            "title": "Variants",
            "type": "integer"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il prezzo al banco del listino di tutti i giorni, IVA compresa; vuoto con più varianti o senza prezzo.",
            "title": "Price Cents"
          },
          "min_price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il prezzo più basso fra le varianti, IVA compresa.",
            "title": "Min Price Cents"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "category_id",
          "department_id",
          "vat_rate",
          "status",
          "variants",
          "price_cents",
          "min_price_cents",
          "updated_at"
        ],
        "title": "ArticleSummary",
        "type": "object"
      },
      "ArticleSummaryPage": {
        "additionalProperties": false,
        "description": "Una pagina di articoli.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/ArticleSummary"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "ArticleSummaryPage",
        "type": "object"
      },
      "ArticlesCategoryIn": {
        "properties": {
          "article_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "title": "Article Ids",
            "type": "array"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La categoria; `null` li toglie da ogni categoria.",
            "title": "Category Id"
          }
        },
        "required": [
          "article_ids",
          "category_id"
        ],
        "title": "ArticlesCategoryIn",
        "type": "object"
      },
      "ArticlesStatusIn": {
        "properties": {
          "article_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "title": "Article Ids",
            "type": "array"
          },
          "status": {
            "description": "on_sale in vendita, suspended sospeso (non si vende oggi), off_menu fuori menu.",
            "enum": [
              "on_sale",
              "suspended",
              "off_menu"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "article_ids",
          "status"
        ],
        "title": "ArticlesStatusIn",
        "type": "object"
      },
      "CancelIn": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "description": "La `version` del tavolo che hai letto: se è cambiato nel frattempo non succede niente (409 table_changed).",
            "minimum": 0,
            "title": "Version",
            "type": "integer"
          },
          "notify": {
            "default": true,
            "description": "Stampa alle postazioni l'avviso di non preparare (come l'iPad dalla build 17).",
            "title": "Notify",
            "type": "boolean"
          }
        },
        "required": [
          "version"
        ],
        "title": "CancelIn",
        "type": "object"
      },
      "Card": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code_end": {
            "description": "Le ultime quattro cifre del codice: il codice intero non esce mai dalla porta.",
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "description": "Dove è stata venduta: banco, shopify, azienda.",
            "title": "Channel",
            "type": "string"
          },
          "state": {
            "description": "pending in attesa della stampa, active attiva, exhausted finita, expired scaduta, blocked bloccata, voided annullata.",
            "enum": [
              "pending",
              "active",
              "exhausted",
              "expired",
              "blocked",
              "voided"
            ],
            "title": "State",
            "type": "string"
          },
          "face_cents": {
            "description": "Il valore di vendita.",
            "title": "Face Cents",
            "type": "integer"
          },
          "balance_cents": {
            "description": "Il saldo.",
            "title": "Balance Cents",
            "type": "integer"
          },
          "available_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il saldo meno quello accantonato da un pagamento in corso.",
            "title": "Available Cents"
          },
          "expires_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expires On",
            "type": "string"
          },
          "sold_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sold At"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il riferimento dello scontrino di vendita.",
            "title": "Receipt"
          },
          "holder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'intestatario, se la cassa l'ha scritto.",
            "title": "Holder"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quanto ha pagato il cliente: sotto il valore quando il taglio ha un bonus.",
            "title": "Price Cents"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultima volta che la carta ha pagato qualcosa.",
            "title": "Last Used At"
          },
          "uses": {
            "description": "Quante volte la carta ha pagato qualcosa (i riaccrediti non tolgono un uso).",
            "title": "Uses",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "code_end",
          "channel",
          "state",
          "face_cents",
          "balance_cents",
          "available_cents",
          "expires_on",
          "sold_at",
          "receipt",
          "holder",
          "price_cents",
          "last_used_at",
          "uses"
        ],
        "title": "Card",
        "type": "object"
      },
      "CardAnomalies": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "From",
            "type": "string"
          },
          "to": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "To",
            "type": "string"
          },
          "sold_and_voided_same_day": {
            "items": {
              "$ref": "#/components/schemas/SoldAndVoided"
            },
            "title": "Sold And Voided Same Day",
            "type": "array"
          },
          "redeemed_within_five_minutes": {
            "items": {
              "$ref": "#/components/schemas/RedeemedSoon"
            },
            "title": "Redeemed Within Five Minutes",
            "type": "array"
          },
          "two_receipts_same_minute": {
            "items": {
              "$ref": "#/components/schemas/TwoReceipts"
            },
            "title": "Two Receipts Same Minute",
            "type": "array"
          },
          "refunds": {
            "items": {
              "$ref": "#/components/schemas/RefundRow"
            },
            "title": "Refunds",
            "type": "array"
          }
        },
        "required": [
          "from",
          "to",
          "sold_and_voided_same_day",
          "redeemed_within_five_minutes",
          "two_receipts_same_minute",
          "refunds"
        ],
        "title": "CardAnomalies",
        "type": "object"
      },
      "CardDetail": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code_end": {
            "description": "Le ultime quattro cifre del codice: il codice intero non esce mai dalla porta.",
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "description": "Dove è stata venduta: banco, shopify, azienda.",
            "title": "Channel",
            "type": "string"
          },
          "state": {
            "description": "pending in attesa della stampa, active attiva, exhausted finita, expired scaduta, blocked bloccata, voided annullata.",
            "enum": [
              "pending",
              "active",
              "exhausted",
              "expired",
              "blocked",
              "voided"
            ],
            "title": "State",
            "type": "string"
          },
          "face_cents": {
            "description": "Il valore di vendita.",
            "title": "Face Cents",
            "type": "integer"
          },
          "balance_cents": {
            "description": "Il saldo.",
            "title": "Balance Cents",
            "type": "integer"
          },
          "available_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il saldo meno quello accantonato da un pagamento in corso.",
            "title": "Available Cents"
          },
          "expires_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expires On",
            "type": "string"
          },
          "sold_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sold At"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il riferimento dello scontrino di vendita.",
            "title": "Receipt"
          },
          "holder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'intestatario, se la cassa l'ha scritto.",
            "title": "Holder"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quanto ha pagato il cliente: sotto il valore quando il taglio ha un bonus.",
            "title": "Price Cents"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultima volta che la carta ha pagato qualcosa.",
            "title": "Last Used At"
          },
          "uses": {
            "description": "Quante volte la carta ha pagato qualcosa (i riaccrediti non tolgono un uso).",
            "title": "Uses",
            "type": "integer"
          },
          "movements": {
            "items": {
              "$ref": "#/components/schemas/CardMovement"
            },
            "title": "Movements",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code_end",
          "channel",
          "state",
          "face_cents",
          "balance_cents",
          "available_cents",
          "expires_on",
          "sold_at",
          "receipt",
          "holder",
          "price_cents",
          "last_used_at",
          "uses",
          "movements"
        ],
        "title": "CardDetail",
        "type": "object"
      },
      "CardLedger": {
        "additionalProperties": false,
        "description": "Il registro del periodo per il commercialista: ogni voce in pagato e in valore.",
        "properties": {
          "from": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "From",
            "type": "string"
          },
          "to": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "To",
            "type": "string"
          },
          "opening": {
            "$ref": "#/components/schemas/Amount",
            "description": "Il debito per carte da usare all'inizio del primo giorno."
          },
          "sold": {
            "$ref": "#/components/schemas/Amount",
            "description": "Le carte vendute (le vendite annullate sono in `refunded`)."
          },
          "used": {
            "$ref": "#/components/schemas/AmountWithBonus",
            "description": "Le carte usate per pagare, al netto dei riaccrediti; il bonus usato è uno sconto sul conto."
          },
          "redeemed": {
            "$ref": "#/components/schemas/Amount",
            "description": "Le carte usate per pagare, prima dei riaccrediti."
          },
          "credited_back": {
            "$ref": "#/components/schemas/Amount",
            "description": "I riaccrediti su una carta (annullo o reso di uno scontrino pagato con la carta)."
          },
          "expired": {
            "$ref": "#/components/schemas/AmountWithBonus",
            "description": "Le carte scadute con saldo, al netto di quelle riaperte con una scadenza nuova: il pagato è sopravvenienza attiva senza IVA (conto 323000)."
          },
          "refunded": {
            "$ref": "#/components/schemas/Amount",
            "description": "Le vendite annullate: soldi restituiti al cliente."
          },
          "closing": {
            "$ref": "#/components/schemas/Amount",
            "description": "Il debito per carte da usare alla fine dell'ultimo giorno."
          },
          "balanced": {
            "description": "Vero quando inizio più vendute meno usate, scadute e rimborsate dà la fine, in pagato e in valore.",
            "title": "Balanced",
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "opening",
          "sold",
          "used",
          "redeemed",
          "credited_back",
          "expired",
          "refunded",
          "closing",
          "balanced"
        ],
        "title": "CardLedger",
        "type": "object"
      },
      "CardMovement": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "issue venduta, void vendita annullata, redeem spesa, refund riaccredito, expire scaduta, adjust rettifica.",
            "enum": [
              "issue",
              "void",
              "redeem",
              "refund",
              "expire",
              "adjust"
            ],
            "title": "Kind",
            "type": "string"
          },
          "cents": {
            "description": "Col segno: più entra sulla carta, meno esce.",
            "title": "Cents",
            "type": "integer"
          },
          "at": {
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il riferimento dello scontrino.",
            "title": "Receipt"
          },
          "device": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Device"
          },
          "by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chi l'ha fatto o approvato.",
            "title": "By"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "kind",
          "cents",
          "at",
          "receipt",
          "device",
          "by",
          "reason"
        ],
        "title": "CardMovement",
        "type": "object"
      },
      "CardPage": {
        "additionalProperties": false,
        "description": "Una pagina di carte regalo.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "CardPage",
        "type": "object"
      },
      "CardPrint": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code": {
            "description": "Il codice intero, 17 caratteri: è il denaro della carta, va trattato come una password.",
            "title": "Code",
            "type": "string"
          },
          "display": {
            "description": "Il codice come si stampa: ABCD-EFGH-JKMN-PQRS-T.",
            "title": "Display",
            "type": "string"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "face_cents": {
            "description": "Il valore di vendita.",
            "title": "Face Cents",
            "type": "integer"
          },
          "balance_cents": {
            "description": "Il saldo.",
            "title": "Balance Cents",
            "type": "integer"
          },
          "expires_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expires On",
            "type": "string"
          },
          "holder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'intestatario, se la cassa l'ha scritto.",
            "title": "Holder"
          },
          "club_card_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Le ultime tre cifre della tessera del Club a cui la carta è legata.",
            "title": "Club Card End"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quanto ha pagato il cliente: sotto il valore quando il taglio ha un bonus.",
            "title": "Price Cents"
          }
        },
        "required": [
          "id",
          "code",
          "display",
          "code_end",
          "face_cents",
          "balance_cents",
          "expires_on",
          "holder",
          "club_card_end",
          "price_cents"
        ],
        "title": "CardPrint",
        "type": "object"
      },
      "CardQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          },
          "state": {
            "anyOf": [
              {
                "enum": [
                  "pending",
                  "active",
                  "exhausted",
                  "expired",
                  "blocked",
                  "voided"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "pending in attesa della stampa, active attiva, exhausted finita, expired scaduta, blocked bloccata, voided annullata.",
            "title": "State"
          },
          "q": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Cerca nell'intestatario o fra le ultime quattro cifre del codice (P24, 08/11/2026).",
            "title": "Q"
          }
        },
        "title": "CardQuery",
        "type": "object"
      },
      "CardReport": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "From",
            "type": "string"
          },
          "to": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "To",
            "type": "string"
          },
          "channels": {
            "$ref": "#/components/schemas/Channels"
          },
          "totals": {
            "$ref": "#/components/schemas/ChannelReport"
          },
          "cards": {
            "description": "Le carte con saldo alla fine del periodo.",
            "items": {
              "$ref": "#/components/schemas/ReportCard"
            },
            "title": "Cards",
            "type": "array"
          }
        },
        "required": [
          "from",
          "to",
          "channels",
          "totals",
          "cards"
        ],
        "title": "CardReport",
        "type": "object"
      },
      "Cash": {
        "additionalProperties": false,
        "properties": {
          "sales_cents": {
            "description": "Contanti entrati con le vendite, resto tolto.",
            "title": "Sales Cents",
            "type": "integer"
          },
          "reversals_cents": {
            "description": "Contanti restituiti con annulli e resi.",
            "title": "Reversals Cents",
            "type": "integer"
          },
          "in_cents": {
            "description": "Versamenti.",
            "title": "In Cents",
            "type": "integer"
          },
          "out_cents": {
            "description": "Prelievi.",
            "title": "Out Cents",
            "type": "integer"
          },
          "expected_cents": {
            "description": "Quello che il cassetto deve contenere: fondo più contanti entrati, meno quelli usciti.",
            "title": "Expected Cents",
            "type": "integer"
          }
        },
        "required": [
          "sales_cents",
          "reversals_cents",
          "in_cents",
          "out_cents",
          "expected_cents"
        ],
        "title": "Cash",
        "type": "object"
      },
      "CashDay": {
        "additionalProperties": false,
        "description": "I numeri di una giornata di cassa, di tutti gli iPad: gli stessi della schermata di chiusura, del file per il\ncommercialista e della registrazione in contabilità.",
        "properties": {
          "since": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da quando: la chiusura prima; vuoto se non ce n'è.",
            "title": "Since"
          },
          "previous_closing": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClosingRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "first": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il primo documento della giornata.",
            "title": "First"
          },
          "last": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultimo documento della giornata.",
            "title": "Last"
          },
          "devices": {
            "description": "Gli iPad che hanno lavorato.",
            "items": {
              "type": "string"
            },
            "title": "Devices",
            "type": "array"
          },
          "float_cents": {
            "description": "Il fondo cassa di partenza.",
            "title": "Float Cents",
            "type": "integer"
          },
          "float_source": {
            "description": "declared dichiarato in giornata, previous_closing lasciato dalla chiusura prima, none nessuno.",
            "enum": [
              "declared",
              "previous_closing",
              "none"
            ],
            "title": "Float Source",
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/Counts"
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "net_cents": {
            "description": "Vendite meno annulli e resi.",
            "title": "Net Cents",
            "type": "integer"
          },
          "discounts": {
            "$ref": "#/components/schemas/Discounts"
          },
          "cash": {
            "$ref": "#/components/schemas/Cash"
          },
          "methods": {
            "items": {
              "$ref": "#/components/schemas/MethodTotal"
            },
            "title": "Methods",
            "type": "array"
          },
          "departments": {
            "items": {
              "$ref": "#/components/schemas/DepartmentTotal"
            },
            "title": "Departments",
            "type": "array"
          },
          "vat": {
            "items": {
              "$ref": "#/components/schemas/VatTotal"
            },
            "title": "Vat",
            "type": "array"
          },
          "vat_unknown": {
            "description": "Reparti con righe senza aliquota nota: restano fuori da `vat`.",
            "items": {
              "type": "string"
            },
            "title": "Vat Unknown",
            "type": "array"
          },
          "operators": {
            "items": {
              "$ref": "#/components/schemas/OperatorTotal"
            },
            "title": "Operators",
            "type": "array"
          },
          "moves": {
            "description": "Versamenti e prelievi.",
            "items": {
              "$ref": "#/components/schemas/DayMove"
            },
            "title": "Moves",
            "type": "array"
          },
          "uncertain": {
            "description": "Documenti in attesa o incerti: non contati finché la cassa non sa.",
            "items": {
              "$ref": "#/components/schemas/Unsure"
            },
            "title": "Uncertain",
            "type": "array"
          },
          "fiscal_days": {
            "description": "Le giornate fiscali (registratore e Z) toccate.",
            "items": {
              "$ref": "#/components/schemas/FiscalDayCount"
            },
            "title": "Fiscal Days",
            "type": "array"
          }
        },
        "required": [
          "since",
          "previous_closing",
          "first",
          "last",
          "devices",
          "float_cents",
          "float_source",
          "counts",
          "totals",
          "net_cents",
          "discounts",
          "cash",
          "methods",
          "departments",
          "vat",
          "vat_unknown",
          "operators",
          "moves",
          "uncertain",
          "fiscal_days"
        ],
        "title": "CashDay",
        "type": "object"
      },
      "CashMove": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "drawer cassetto aperto senza vendita, cash_in versamento, cash_out prelievo, float fondo cassa dichiarato, x_reading lettura X, reprint ristampa di una copia.",
            "enum": [
              "drawer",
              "cash_in",
              "cash_out",
              "float",
              "x_reading",
              "reprint"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "enum": [
              "printed",
              "pending",
              "uncertain",
              "failed",
              "not_printed"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "day": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Day",
            "type": "string"
          },
          "device": {
            "title": "Device",
            "type": "string"
          },
          "device_name": {
            "title": "Device Name",
            "type": "string"
          },
          "road": {
            "description": "La strada della cassa: D è il servizio vero; le altre sono prova e addestramento (non contano negli incassi della Panoramica).",
            "title": "Road",
            "type": "string"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Operator"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          },
          "cents": {
            "description": "L'importo (versamento, prelievo, fondo); zero dove non c'è.",
            "title": "Cents",
            "type": "integer"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il motivo scritto alla cassa.",
            "title": "Note"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "day",
          "device",
          "device_name",
          "road",
          "operator",
          "approved_by",
          "cents",
          "note"
        ],
        "title": "CashMove",
        "type": "object"
      },
      "CashMovePage": {
        "additionalProperties": false,
        "description": "Una pagina di movimenti di cassa.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/CashMove"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "CashMovePage",
        "type": "object"
      },
      "CashMoveQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          },
          "from": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Dal giorno (compreso), nell'ora del locale.",
            "title": "From"
          },
          "to": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Fino al giorno (compreso), nell'ora del locale.",
            "title": "To"
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "drawer",
                  "cash_in",
                  "cash_out",
                  "float",
                  "x_reading",
                  "reprint"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "drawer cassetto aperto senza vendita, cash_in versamento, cash_out prelievo, float fondo cassa dichiarato, x_reading lettura X, reprint ristampa di una copia.",
            "title": "Kind"
          },
          "device": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_.\\-]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il codice di un iPad: solo i suoi.",
            "title": "Device"
          }
        },
        "title": "CashMoveQuery",
        "type": "object"
      },
      "CatalogStarted": {
        "additionalProperties": false,
        "properties": {
          "list_made": {
            "description": "Nato adesso il «Listino base», il listino di tutti i giorni.",
            "title": "List Made",
            "type": "boolean"
          },
          "department_made": {
            "description": "Nato adesso il reparto «Somministrazione», IVA al 10%.",
            "title": "Department Made",
            "type": "boolean"
          }
        },
        "required": [
          "list_made",
          "department_made"
        ],
        "title": "CatalogStarted",
        "type": "object"
      },
      "Category": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La categoria che la contiene, se c'è.",
            "title": "Parent Id"
          },
          "sort": {
            "description": "L'ordine in cassa.",
            "title": "Sort",
            "type": "integer"
          },
          "colour": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il colore del tasto in cassa, `#RRGGBB`.",
            "title": "Colour"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "parent_id",
          "sort",
          "colour"
        ],
        "title": "Category",
        "type": "object"
      },
      "CategoryIn": {
        "properties": {
          "name": {
            "description": "Diverso da quello di ogni altra categoria. Il codice nasce dal nome.",
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CategoryIn",
        "type": "object"
      },
      "CategoryPage": {
        "additionalProperties": false,
        "description": "Una pagina di categorie.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Category"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "CategoryPage",
        "type": "object"
      },
      "CategoryQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                "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": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "After"
          }
        },
        "title": "CategoryQuery",
        "type": "object"
      },
      "CellIn": {
        "properties": {
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro, IVA compresa: da 0 a 100.000 euro.",
                "maximum": 10000000,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il prezzo di questo listino; `null` lo toglie e la cassa vende al prezzo del listino a cui si appoggia.",
            "title": "Price Cents"
          }
        },
        "required": [
          "price_cents"
        ],
        "title": "CellIn",
        "type": "object"
      },
      "Changed": {
        "additionalProperties": false,
        "properties": {
          "changed": {
            "description": "Quanti sono cambiati davvero (quelli già così non contano).",
            "title": "Changed",
            "type": "integer"
          }
        },
        "required": [
          "changed"
        ],
        "title": "Changed",
        "type": "object"
      },
      "ChannelReport": {
        "additionalProperties": false,
        "properties": {
          "sold": {
            "$ref": "#/components/schemas/Flow"
          },
          "voided": {
            "$ref": "#/components/schemas/Flow"
          },
          "redeemed": {
            "$ref": "#/components/schemas/Flow"
          },
          "refunded": {
            "$ref": "#/components/schemas/Flow"
          },
          "expired": {
            "$ref": "#/components/schemas/Flow"
          },
          "adjusted": {
            "$ref": "#/components/schemas/Flow"
          },
          "balance_start_cents": {
            "description": "In centesimi di euro.",
            "title": "Balance Start Cents",
            "type": "integer"
          },
          "balance_end_cents": {
            "description": "In centesimi di euro.",
            "title": "Balance End Cents",
            "type": "integer"
          }
        },
        "required": [
          "sold",
          "voided",
          "redeemed",
          "refunded",
          "expired",
          "adjusted",
          "balance_start_cents",
          "balance_end_cents"
        ],
        "title": "ChannelReport",
        "type": "object"
      },
      "Channels": {
        "additionalProperties": false,
        "description": "Per canale: venduto, annullato, speso, riaccreditato, scaduto, rettificato, saldo all'inizio e alla fine.",
        "properties": {
          "banco": {
            "$ref": "#/components/schemas/ChannelReport"
          },
          "shopify": {
            "$ref": "#/components/schemas/ChannelReport"
          },
          "azienda": {
            "$ref": "#/components/schemas/ChannelReport"
          }
        },
        "required": [
          "banco",
          "shopify",
          "azienda"
        ],
        "title": "Channels",
        "type": "object"
      },
      "Closing": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "closing chiusura del giorno con conteggio e Z, z_report Z senza conteggio.",
            "enum": [
              "closing",
              "z_report"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "enum": [
              "printed",
              "pending",
              "uncertain",
              "failed",
              "not_printed"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "day": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Day",
            "type": "string"
          },
          "device": {
            "title": "Device",
            "type": "string"
          },
          "device_name": {
            "title": "Device Name",
            "type": "string"
          },
          "road": {
            "description": "La strada della cassa: D è il servizio vero; le altre sono prova e addestramento (non contano negli incassi della Panoramica).",
            "title": "Road",
            "type": "string"
          },
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial"
          },
          "z_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Z Number"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Operator"
          },
          "counted_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "I contanti contati al buio.",
            "title": "Counted Cents"
          },
          "expected_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "I contanti attesi.",
            "title": "Expected Cents"
          },
          "difference_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contati meno attesi.",
            "title": "Difference Cents"
          },
          "deposit_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Versati in banca.",
            "title": "Deposit Cents"
          },
          "float_next_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il fondo lasciato per il giorno dopo.",
            "title": "Float Next Cents"
          },
          "training": {
            "description": "Chiusura di prova (strada di addestramento).",
            "title": "Training",
            "type": "boolean"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "accounting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Accounting"
              },
              {
                "type": "null"
              }
            ],
            "description": "La registrazione in contabilità; vuoto se non è ancora partita."
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "day",
          "device",
          "device_name",
          "road",
          "serial",
          "z_number",
          "operator",
          "counted_cents",
          "expected_cents",
          "difference_cents",
          "deposit_cents",
          "float_next_cents",
          "training",
          "note",
          "accounting"
        ],
        "title": "Closing",
        "type": "object"
      },
      "ClosingDetail": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "closing chiusura del giorno con conteggio e Z, z_report Z senza conteggio.",
            "enum": [
              "closing",
              "z_report"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "enum": [
              "printed",
              "pending",
              "uncertain",
              "failed",
              "not_printed"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "day": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Day",
            "type": "string"
          },
          "device": {
            "title": "Device",
            "type": "string"
          },
          "device_name": {
            "title": "Device Name",
            "type": "string"
          },
          "road": {
            "description": "La strada della cassa: D è il servizio vero; le altre sono prova e addestramento (non contano negli incassi della Panoramica).",
            "title": "Road",
            "type": "string"
          },
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial"
          },
          "z_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Z Number"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Operator"
          },
          "counted_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "I contanti contati al buio.",
            "title": "Counted Cents"
          },
          "expected_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "I contanti attesi.",
            "title": "Expected Cents"
          },
          "difference_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contati meno attesi.",
            "title": "Difference Cents"
          },
          "deposit_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Versati in banca.",
            "title": "Deposit Cents"
          },
          "float_next_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il fondo lasciato per il giorno dopo.",
            "title": "Float Next Cents"
          },
          "training": {
            "description": "Chiusura di prova (strada di addestramento).",
            "title": "Training",
            "type": "boolean"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "accounting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Accounting"
              },
              {
                "type": "null"
              }
            ],
            "description": "La registrazione in contabilità; vuoto se non è ancora partita."
          },
          "cash_day": {
            "$ref": "#/components/schemas/CashDay",
            "description": "La giornata di cassa che la chiusura ha chiuso."
          },
          "fiscal_day": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CashDay"
              },
              {
                "type": "null"
              }
            ],
            "description": "Scontrini, annulli e resi chiusi da questa Z, di tutti gli iPad; vuoto senza matricola o numero di Z."
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "day",
          "device",
          "device_name",
          "road",
          "serial",
          "z_number",
          "operator",
          "counted_cents",
          "expected_cents",
          "difference_cents",
          "deposit_cents",
          "float_next_cents",
          "training",
          "note",
          "accounting",
          "cash_day",
          "fiscal_day"
        ],
        "title": "ClosingDetail",
        "type": "object"
      },
      "ClosingPage": {
        "additionalProperties": false,
        "description": "Una pagina di chiusure.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Closing"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "ClosingPage",
        "type": "object"
      },
      "ClosingQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          }
        },
        "title": "ClosingQuery",
        "type": "object"
      },
      "ClosingRef": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "z_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Z Number"
          }
        },
        "required": [
          "id",
          "created_at",
          "z_number"
        ],
        "title": "ClosingRef",
        "type": "object"
      },
      "ClubPosting": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "sale punti della vendita, reversal punti tolti da un annullo o un reso.",
            "enum": [
              "sale",
              "reversal"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "La risposta del Club quando l'ha preso: done fatto, pending in attesa, unknown_card tessera sconosciuta, review da guardare.",
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "state",
          "created_at"
        ],
        "title": "ClubPosting",
        "type": "object"
      },
      "ClubPostingRow": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "sale punti della vendita, reversal punti tolti da un annullo o un reso.",
            "enum": [
              "sale",
              "reversal"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "La risposta del Club quando l'ha preso: done fatto, pending in attesa, unknown_card tessera sconosciuta, review da guardare.",
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "receipt": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Receipt",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "state",
          "created_at",
          "receipt"
        ],
        "title": "ClubPostingRow",
        "type": "object"
      },
      "ClubPostingRowPage": {
        "additionalProperties": false,
        "description": "Una pagina di passaggi al Club.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/ClubPostingRow"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "ClubPostingRowPage",
        "type": "object"
      },
      "CommandError": {
        "additionalProperties": false,
        "properties": {
          "status": {
            "title": "Status",
            "type": "integer"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "status",
          "code",
          "message"
        ],
        "title": "CommandError",
        "type": "object"
      },
      "Counts": {
        "additionalProperties": false,
        "properties": {
          "sales": {
            "title": "Sales",
            "type": "integer"
          },
          "voids": {
            "title": "Voids",
            "type": "integer"
          },
          "refunds": {
            "title": "Refunds",
            "type": "integer"
          },
          "training": {
            "description": "Vendite di addestramento, già contate in `sales`.",
            "title": "Training",
            "type": "integer"
          },
          "drawer": {
            "description": "Cassetto aperto senza vendita.",
            "title": "Drawer",
            "type": "integer"
          }
        },
        "required": [
          "sales",
          "voids",
          "refunds",
          "training",
          "drawer"
        ],
        "title": "Counts",
        "type": "object"
      },
      "Created": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo di ciò che è nato.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "Created",
        "type": "object"
      },
      "CreditNoteIn": {
        "properties": {
          "quantities": {
            "anyOf": [
              {
                "additionalProperties": {
                  "examples": [
                    "1.50",
                    22
                  ],
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "propertyNames": {
                  "format": "uuid"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Per stornare solo una parte: id della riga e quantità. Se manca, tutto.",
            "title": "Quantities"
          },
          "issue": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true per emetterla subito.",
            "title": "Issue"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Issue Date"
          }
        },
        "title": "CreditNoteIn",
        "type": "object"
      },
      "DayMove": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "cash_in",
              "cash_out"
            ],
            "title": "Kind",
            "type": "string"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Operator"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "device": {
            "title": "Device",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "cents",
          "reason",
          "operator",
          "approved_by",
          "created_at",
          "device"
        ],
        "title": "DayMove",
        "type": "object"
      },
      "Department": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "vat_rate_id": {
            "format": "uuid",
            "title": "Vat Rate Id",
            "type": "string"
          },
          "vat_rate": {
            "description": "L'aliquota in percento.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Vat Rate",
            "type": "string"
          },
          "nature": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La natura IVA per l'aliquota zero (N1-N7).",
            "title": "Nature"
          },
          "ateco": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ateco"
          },
          "articles": {
            "description": "Quanti articoli lo usano (fuori menu esclusi).",
            "title": "Articles",
            "type": "integer"
          },
          "printers": {
            "description": "Il numero di reparto sulla stampante di ogni sede.",
            "items": {
              "$ref": "#/components/schemas/SitePrinter"
            },
            "title": "Printers",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "vat_rate_id",
          "vat_rate",
          "nature",
          "ateco",
          "articles",
          "printers"
        ],
        "title": "Department",
        "type": "object"
      },
      "DepartmentIn": {
        "properties": {
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo. Se manca, nasce dal nome.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Code"
          },
          "vat_rate_id": {
            "description": "Un'aliquota valida oggi (vedi `/vat_rates`).",
            "format": "uuid",
            "title": "Vat Rate Id",
            "type": "string"
          },
          "ateco": {
            "anyOf": [
              {
                "description": "Come 56.30 oppure 47.24.1.",
                "pattern": "^[0-9]{2}(\\.[0-9]{1,2}){0,2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ateco"
          }
        },
        "required": [
          "name",
          "vat_rate_id"
        ],
        "title": "DepartmentIn",
        "type": "object"
      },
      "DepartmentPage": {
        "additionalProperties": false,
        "description": "Una pagina di reparti.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Department"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "DepartmentPage",
        "type": "object"
      },
      "DepartmentPatch": {
        "description": "Si cambiano solo i campi che mandi. Cambiare l'aliquota cambia l'IVA delle prossime vendite, mai delle\npassate.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo. Se manca, nasce dal nome.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Code"
          },
          "vat_rate_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Vat Rate Id"
          },
          "ateco": {
            "anyOf": [
              {
                "description": "Come 56.30 oppure 47.24.1.",
                "pattern": "^[0-9]{2}(\\.[0-9]{1,2}){0,2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ateco"
          }
        },
        "title": "DepartmentPatch",
        "type": "object"
      },
      "DepartmentTotal": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "vat_rate": {
            "anyOf": [
              {
                "description": "Numero decimale come testo, senza arrotondamenti.",
                "pattern": "^-?\\d+(\\.\\d+)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Rate"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "vat_rate",
          "cents"
        ],
        "title": "DepartmentTotal",
        "type": "object"
      },
      "DeriveIn": {
        "description": "Un documento nuovo da questo: l'ordine dal preventivo, il DDT dall'ordine, la fattura dal DDT.",
        "properties": {
          "kind": {
            "description": "Il tipo del documento nuovo: quote preventivo, proforma fattura proforma, order ordine, delivery_note DDT, invoice fattura, credit_note nota di credito, receipt scontrino, return reso, purchase_order ordine al fornitore, purchase_invoice fattura d'acquisto, self_invoice autofattura.",
            "enum": [
              "quote",
              "proforma",
              "order",
              "delivery_note",
              "invoice",
              "credit_note",
              "receipt",
              "return",
              "purchase_order",
              "purchase_invoice",
              "self_invoice"
            ],
            "title": "Kind",
            "type": "string"
          },
          "quantities": {
            "anyOf": [
              {
                "additionalProperties": {
                  "examples": [
                    "1.50",
                    22
                  ],
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "propertyNames": {
                  "format": "uuid"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Per prenderne solo una parte: id della riga e quantità. Se manca, tutto il residuo.",
            "title": "Quantities"
          }
        },
        "required": [
          "kind"
        ],
        "title": "DeriveIn",
        "type": "object"
      },
      "DeviceRenameIn": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "Il nome nuovo, da 1 a 30 caratteri; gli spazi in più si tolgono.",
            "maxLength": 30,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "DeviceRenameIn",
        "type": "object"
      },
      "Discounts": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "cents"
        ],
        "title": "Discounts",
        "type": "object"
      },
      "Document": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "quote preventivo, proforma fattura proforma, order ordine, delivery_note DDT, invoice fattura, credit_note nota di credito, receipt scontrino, return reso, purchase_order ordine al fornitore, purchase_invoice fattura d'acquisto, self_invoice autofattura.",
            "title": "Kind",
            "type": "string"
          },
          "direction": {
            "description": "out emesso da te, in ricevuto.",
            "enum": [
              "out",
              "in"
            ],
            "title": "Direction",
            "type": "string"
          },
          "status": {
            "description": "draft bozza, issued emesso, rejected scartato dallo SDI (si corregge e si riemette), discarded bozza scartata.",
            "enum": [
              "draft",
              "issued",
              "rejected",
              "discarded"
            ],
            "title": "Status",
            "type": "string"
          },
          "series_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Id"
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'anno della numerazione.",
            "title": "Year"
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il progressivo nella serie e nell'anno.",
            "title": "Number"
          },
          "number_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero come si stampa, dopo l'emissione.",
            "title": "Number Text"
          },
          "issue_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "currency": {
            "description": "EUR.",
            "title": "Currency",
            "type": "string"
          },
          "prices_include_tax": {
            "title": "Prices Include Tax",
            "type": "boolean"
          },
          "net_cents": {
            "description": "Imponibile, in centesimi.",
            "title": "Net Cents",
            "type": "integer"
          },
          "tax_cents": {
            "description": "IVA, in centesimi.",
            "title": "Tax Cents",
            "type": "integer"
          },
          "total_cents": {
            "description": "Totale, in centesimi.",
            "title": "Total Cents",
            "type": "integer"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "origin": {
            "description": "Da dove arriva: backoffice, cassa, sdi, pdf, import.",
            "title": "Origin",
            "type": "string"
          },
          "origin_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Ref"
          },
          "site": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Receipt"
              },
              {
                "type": "null"
              }
            ],
            "description": "Lo scontrino che la fattura segue."
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'oggetto.",
            "title": "Subject"
          },
          "order_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero d'ordine del cliente.",
            "title": "Order Ref"
          },
          "payment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentPayment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Come e quando si paga."
          },
          "party": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Party"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il soggetto; dopo l'emissione, com'era in quel momento."
          },
          "issuer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Issuer"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'azienda com'era all'emissione; vuoto sulle bozze."
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Line"
            },
            "title": "Lines",
            "type": "array"
          },
          "taxes": {
            "description": "Il riepilogo per aliquota.",
            "items": {
              "$ref": "#/components/schemas/Tax"
            },
            "title": "Taxes",
            "type": "array"
          },
          "it": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentIt"
              },
              {
                "type": "null"
              }
            ],
            "description": "I dati della fattura elettronica italiana, quando il documento ne ha."
          },
          "related": {
            "description": "I documenti che storna.",
            "items": {
              "$ref": "#/components/schemas/Related"
            },
            "title": "Related",
            "type": "array"
          },
          "sdi_state": {
            "anyOf": [
              {
                "enum": [
                  "queued",
                  "submitted",
                  "failed",
                  "sent",
                  "delivered",
                  "not_delivered",
                  "rejected",
                  "accepted",
                  "refused",
                  "expired"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Lo stato dell'ultimo invio allo SDI.",
            "title": "Sdi State"
          }
        },
        "required": [
          "id",
          "kind",
          "direction",
          "status",
          "series_id",
          "year",
          "number",
          "number_text",
          "issue_date",
          "currency",
          "prices_include_tax",
          "net_cents",
          "tax_cents",
          "total_cents",
          "notes",
          "origin",
          "origin_ref",
          "site",
          "receipt",
          "subject",
          "order_ref",
          "payment",
          "party",
          "issuer",
          "lines",
          "taxes",
          "it",
          "related",
          "sdi_state"
        ],
        "title": "Document",
        "type": "object"
      },
      "DocumentIn": {
        "description": "Una bozza, con le righe e, se vuoi, l'emissione nella stessa chiamata: o nasce intera o non nasce.",
        "properties": {
          "kind": {
            "description": "quote preventivo, proforma fattura proforma, order ordine, delivery_note DDT, invoice fattura, credit_note nota di credito, receipt scontrino, return reso, purchase_order ordine al fornitore, purchase_invoice fattura d'acquisto, self_invoice autofattura.",
            "enum": [
              "quote",
              "proforma",
              "order",
              "delivery_note",
              "invoice",
              "credit_note",
              "receipt",
              "return",
              "purchase_order",
              "purchase_invoice",
              "self_invoice"
            ],
            "title": "Kind",
            "type": "string"
          },
          "party_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il soggetto (da /parties).",
            "title": "Party Id"
          },
          "series_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "La serie che lo numera (da /series).",
            "title": "Series Id"
          },
          "prices_include_tax": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true se i prezzi delle righe sono IVA inclusa. Se manca, false.",
            "title": "Prices Include Tax"
          },
          "site": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "La sede, quando l'azienda ne ha più d'una.",
            "title": "Site"
          },
          "origin": {
            "anyOf": [
              {
                "enum": [
                  "backoffice",
                  "cassa",
                  "sdi",
                  "pdf",
                  "import"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Da dove arriva. Se manca, backoffice.",
            "title": "Origin"
          },
          "origin_ref": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il tuo riferimento (numero d'ordine, ...).",
            "title": "Origin Ref"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Notes"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReceiptIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Solo per una fattura che segue uno scontrino."
          },
          "subject": {
            "anyOf": [
              {
                "description": "L'oggetto della fattura (va nella Causale).",
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Subject"
          },
          "order_ref": {
            "anyOf": [
              {
                "description": "Il numero d'ordine del cliente (va in DatiOrdineAcquisto).",
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Order Ref"
          },
          "payment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentPaymentIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "I termini di pagamento. Se mancano, il documento non ne dice niente."
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LineIn"
                },
                "maxItems": 500,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Lines"
          },
          "issue": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true per emetterlo subito (serve anche la porta `documents.issue`).",
            "title": "Issue"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Data di emissione. Se manca, oggi (ora italiana).",
            "title": "Issue Date"
          }
        },
        "required": [
          "kind"
        ],
        "title": "DocumentIn",
        "type": "object"
      },
      "DocumentIt": {
        "additionalProperties": false,
        "properties": {
          "td_type": {
            "description": "Tipo documento SDI (TD01 fattura, TD04 nota di credito).",
            "title": "Td Type",
            "type": "string"
          },
          "sdi_code": {
            "title": "Sdi Code",
            "type": "string"
          },
          "pec": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pec"
          },
          "stamp_duty": {
            "description": "Bollo da 2 euro dovuto.",
            "title": "Stamp Duty",
            "type": "boolean"
          },
          "vat_due": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Due"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "td_type",
          "sdi_code",
          "pec",
          "stamp_duty",
          "vat_due",
          "reason"
        ],
        "title": "DocumentIt",
        "type": "object"
      },
      "DocumentPayment": {
        "additionalProperties": false,
        "properties": {
          "days": {
            "description": "Giorni dalla data del documento: 0 alla consegna.",
            "title": "Days",
            "type": "integer"
          },
          "end_of_month": {
            "description": "La scadenza va all'ultimo giorno del mese.",
            "title": "End Of Month",
            "type": "boolean"
          },
          "method": {
            "description": "MP01 contanti, MP02 assegno, MP05 bonifico (con l'IBAN), MP08 carta, MP12 RiBa, MP19 addebito diretto SEPA.",
            "title": "Method",
            "type": "string"
          },
          "iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iban"
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La scadenza, calcolata dalla data di emissione; vuota sulle bozze e sulle note di credito.",
            "title": "Due Date"
          }
        },
        "required": [
          "days",
          "end_of_month",
          "method",
          "iban",
          "due_date"
        ],
        "title": "DocumentPayment",
        "type": "object"
      },
      "DocumentPaymentIn": {
        "description": "Come e quando si paga. La scadenza non si scrive: si calcola dalla data di emissione.",
        "properties": {
          "days": {
            "default": 0,
            "description": "Giorni dalla data del documento: 0 alla consegna.",
            "enum": [
              0,
              15,
              30,
              60,
              90
            ],
            "title": "Days",
            "type": "integer"
          },
          "end_of_month": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "true per portare la scadenza all'ultimo giorno del mese (30 giorni fine mese).",
            "title": "End Of Month"
          },
          "method": {
            "description": "MP01 contanti, MP02 assegno, MP05 bonifico (con l'IBAN), MP08 carta, MP12 RiBa, MP19 addebito diretto SEPA.",
            "enum": [
              "MP01",
              "MP02",
              "MP05",
              "MP08",
              "MP12",
              "MP19"
            ],
            "title": "Method",
            "type": "string"
          },
          "iban": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z]{2}[0-9]{2}[A-Za-z0-9 ]{11,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il conto su cui arriva il pagamento; obbligatorio col bonifico.",
            "title": "Iban"
          }
        },
        "required": [
          "method"
        ],
        "title": "DocumentPaymentIn",
        "type": "object"
      },
      "DocumentQuery": {
        "properties": {
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "quote",
                  "proforma",
                  "order",
                  "delivery_note",
                  "invoice",
                  "credit_note",
                  "receipt",
                  "return",
                  "purchase_order",
                  "purchase_invoice",
                  "self_invoice"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "quote preventivo, proforma fattura proforma, order ordine, delivery_note DDT, invoice fattura, credit_note nota di credito, receipt scontrino, return reso, purchase_order ordine al fornitore, purchase_invoice fattura d'acquisto, self_invoice autofattura.",
            "title": "Kind"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "draft",
                  "issued",
                  "rejected",
                  "discarded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "draft bozza, issued emesso, rejected scartato dallo SDI, discarded bozza scartata.",
            "title": "Status"
          },
          "party_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "I documenti di un soggetto.",
            "title": "Party Id"
          },
          "sdi_state": {
            "anyOf": [
              {
                "enum": [
                  "queued",
                  "submitted",
                  "failed",
                  "sent",
                  "delivered",
                  "not_delivered",
                  "rejected",
                  "accepted",
                  "refused",
                  "expired"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Lo stato dell'ultimo invio allo SDI.",
            "title": "Sdi State"
          },
          "q": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Cerca nel numero e nel nome del soggetto.",
            "title": "Q"
          },
          "receipt_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Per cercare la fattura di uno scontrino: insieme a receipt_number e receipt_date.",
            "title": "Receipt Ref"
          },
          "receipt_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Receipt Number"
          },
          "receipt_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Receipt Date"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti, da 1 a 100 (se manca, 50). I più recenti per primi.",
            "title": "Limit"
          },
          "offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti saltarne, per leggere l'elenco a pagine (se manca, 0).",
            "title": "Offset"
          }
        },
        "title": "DocumentQuery",
        "type": "object"
      },
      "DocumentSummary": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "direction": {
            "title": "Direction",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "rejected",
              "discarded"
            ],
            "title": "Status",
            "type": "string"
          },
          "number_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number Text"
          },
          "issue_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "net_cents": {
            "description": "In centesimi di euro.",
            "title": "Net Cents",
            "type": "integer"
          },
          "tax_cents": {
            "description": "In centesimi di euro.",
            "title": "Tax Cents",
            "type": "integer"
          },
          "total_cents": {
            "description": "In centesimi di euro.",
            "title": "Total Cents",
            "type": "integer"
          },
          "party_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Party Id"
          },
          "origin": {
            "title": "Origin",
            "type": "string"
          },
          "origin_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Ref"
          },
          "site": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "party_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il nome del soggetto; dopo l'emissione, com'era in quel momento.",
            "title": "Party Name"
          },
          "sdi_state": {
            "anyOf": [
              {
                "enum": [
                  "queued",
                  "submitted",
                  "failed",
                  "sent",
                  "delivered",
                  "not_delivered",
                  "rejected",
                  "accepted",
                  "refused",
                  "expired"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Lo stato dell'ultimo invio allo SDI.",
            "title": "Sdi State"
          },
          "pay_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'IBAN su cui si paga, se il documento lo dice.",
            "title": "Pay Iban"
          }
        },
        "required": [
          "id",
          "kind",
          "direction",
          "status",
          "number_text",
          "issue_date",
          "net_cents",
          "tax_cents",
          "total_cents",
          "party_id",
          "origin",
          "origin_ref",
          "site",
          "created_at",
          "party_name",
          "sdi_state",
          "pay_iban"
        ],
        "title": "DocumentSummary",
        "type": "object"
      },
      "DocumentUpdate": {
        "description": "Quello che cambia in una bozza; quello che manca resta com'è.",
        "properties": {
          "party_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il soggetto (da /parties).",
            "title": "Party Id"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Notes"
          },
          "prices_include_tax": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Prices Include Tax"
          },
          "subject": {
            "anyOf": [
              {
                "description": "L'oggetto della fattura (va nella Causale).",
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "L'oggetto; null per toglierlo.",
            "title": "Subject"
          },
          "order_ref": {
            "anyOf": [
              {
                "description": "Il numero d'ordine del cliente (va in DatiOrdineAcquisto).",
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il numero d'ordine del cliente; null per toglierlo.",
            "title": "Order Ref"
          },
          "payment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentPaymentIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "I termini di pagamento, tutti insieme; null per toglierli."
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LineIn"
                },
                "maxItems": 500,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Tutte le righe: sostituiscono quelle che c'erano.",
            "title": "Lines"
          }
        },
        "title": "DocumentUpdate",
        "type": "object"
      },
      "DuplicateIn": {
        "properties": {
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo. Se manca, nasce dal nome.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Code"
          }
        },
        "required": [
          "name"
        ],
        "title": "DuplicateIn",
        "type": "object"
      },
      "Empty": {
        "additionalProperties": false,
        "properties": {},
        "title": "Empty",
        "type": "object"
      },
      "Error": {
        "additionalProperties": true,
        "description": "Every refusal of the suite, in one shape (cmp_api.errors).",
        "properties": {
          "error": {
            "description": "Il testo per la persona, in italiano: si può mostrare così com'è.",
            "title": "Error",
            "type": "string"
          },
          "code": {
            "description": "Il codice stabile per il programma: si decide su questo, mai sul testo.",
            "title": "Code",
            "type": "string"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il dato a cui si riferisce, quando ce n'è uno (per esempio `lines.0.tax_rate`).",
            "title": "Field"
          },
          "request_id": {
            "description": "Il numero della pratica: è anche nei nostri registri, citalo quando chiedi aiuto.",
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "error",
          "code",
          "request_id"
        ],
        "title": "Error",
        "type": "object"
      },
      "EventQuery": {
        "properties": {
          "table": {
            "anyOf": [
              {
                "description": "Il tavolo, come nella pianta (`id`).",
                "pattern": "^[A-Za-z0-9_\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Table"
          },
          "kind": {
            "anyOf": [
              {
                "pattern": "^[a-z\\-]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Kind"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[0-9]{1,18}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          }
        },
        "title": "EventQuery",
        "type": "object"
      },
      "FiscalDayCount": {
        "additionalProperties": false,
        "properties": {
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial"
          },
          "z_number": {
            "title": "Z Number",
            "type": "integer"
          },
          "documents": {
            "title": "Documents",
            "type": "integer"
          }
        },
        "required": [
          "serial",
          "z_number",
          "documents"
        ],
        "title": "FiscalDayCount",
        "type": "object"
      },
      "Floor": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "description": "La versione della pianta pubblicata.",
            "title": "Version",
            "type": "string"
          },
          "areas": {
            "items": {
              "$ref": "#/components/schemas/FloorArea"
            },
            "title": "Areas",
            "type": "array"
          },
          "room": {
            "$ref": "#/components/schemas/Room"
          }
        },
        "required": [
          "version",
          "areas",
          "room"
        ],
        "title": "Floor",
        "type": "object"
      },
      "FloorArea": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/FloorTable"
            },
            "title": "Tables",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "tables"
        ],
        "title": "FloorArea",
        "type": "object"
      },
      "FloorAreaIn": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Il tavolo, come nella pianta (`id`).",
            "pattern": "^[A-Za-z0-9_\\-]{1,40}$",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "maxLength": 40,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/FloorTableIn"
            },
            "maxItems": 100,
            "minItems": 1,
            "title": "Tables",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "tables"
        ],
        "title": "FloorAreaIn",
        "type": "object"
      },
      "FloorIn": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "description": "Un nome per questa versione della pianta.",
            "maxLength": 40,
            "minLength": 1,
            "title": "Version",
            "type": "string"
          },
          "areas": {
            "items": {
              "$ref": "#/components/schemas/FloorAreaIn"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Areas",
            "type": "array"
          }
        },
        "required": [
          "version",
          "areas"
        ],
        "title": "FloorIn",
        "type": "object"
      },
      "FloorPublished": {
        "additionalProperties": false,
        "properties": {
          "published": {
            "title": "Published",
            "type": "string"
          },
          "tables": {
            "title": "Tables",
            "type": "integer"
          }
        },
        "required": [
          "published",
          "tables"
        ],
        "title": "FloorPublished",
        "type": "object"
      },
      "FloorTable": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "seats": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "I posti, se la pianta li dice.",
            "title": "Seats"
          }
        },
        "required": [
          "id",
          "name",
          "seats"
        ],
        "title": "FloorTable",
        "type": "object"
      },
      "FloorTableIn": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Il tavolo, come nella pianta (`id`).",
            "pattern": "^[A-Za-z0-9_\\-]{1,40}$",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "maxLength": 20,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "seats": {
            "anyOf": [
              {
                "maximum": 50,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Seats"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "FloorTableIn",
        "type": "object"
      },
      "Flow": {
        "additionalProperties": false,
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "cents"
        ],
        "title": "Flow",
        "type": "object"
      },
      "Hour": {
        "additionalProperties": false,
        "properties": {
          "hour": {
            "description": "L'ora del locale, da 0 a 23.",
            "title": "Hour",
            "type": "integer"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "receipts": {
            "title": "Receipts",
            "type": "integer"
          }
        },
        "required": [
          "hour",
          "cents",
          "receipts"
        ],
        "title": "Hour",
        "type": "object"
      },
      "InvoiceRequest": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "invoice fattura dello scontrino, credit_note nota di credito di un reso.",
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "queued in coda, issued emessa, error da guardare, withdrawn ritirata.",
            "title": "State",
            "type": "string"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero del documento emesso.",
            "title": "Number"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "total_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cents"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La ragione sociale o il nome del cliente.",
            "title": "Customer"
          },
          "problem": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cosa non è andato, finché non è emessa.",
            "title": "Problem"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "state",
          "number",
          "issue_date",
          "total_cents",
          "customer",
          "problem",
          "created_at"
        ],
        "title": "InvoiceRequest",
        "type": "object"
      },
      "InvoiceRequestQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          },
          "state": {
            "anyOf": [
              {
                "enum": [
                  "queued",
                  "issued",
                  "error",
                  "withdrawn"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Solo in questo stato.",
            "title": "State"
          }
        },
        "title": "InvoiceRequestQuery",
        "type": "object"
      },
      "InvoiceRequestRow": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "invoice fattura dello scontrino, credit_note nota di credito di un reso.",
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "queued in coda, issued emessa, error da guardare, withdrawn ritirata.",
            "title": "State",
            "type": "string"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero del documento emesso.",
            "title": "Number"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "total_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cents"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La ragione sociale o il nome del cliente.",
            "title": "Customer"
          },
          "problem": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cosa non è andato, finché non è emessa.",
            "title": "Problem"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "receipt": {
            "description": "Lo scontrino (o il reso) da cui è nata.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Receipt",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "state",
          "number",
          "issue_date",
          "total_cents",
          "customer",
          "problem",
          "created_at",
          "receipt"
        ],
        "title": "InvoiceRequestRow",
        "type": "object"
      },
      "InvoiceRequestRowPage": {
        "additionalProperties": false,
        "description": "Una pagina di richieste di fattura.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/InvoiceRequestRow"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "InvoiceRequestRowPage",
        "type": "object"
      },
      "IssueIn": {
        "properties": {
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Data di emissione. Se manca, oggi (ora italiana).",
            "title": "Issue Date"
          }
        },
        "title": "IssueIn",
        "type": "object"
      },
      "Issuer": {
        "additionalProperties": false,
        "description": "I dati fiscali dell'azienda.",
        "properties": {
          "country": {
            "title": "Country",
            "type": "string"
          },
          "legal_name": {
            "title": "Legal Name",
            "type": "string"
          },
          "vat_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscal Code"
          },
          "street": {
            "title": "Street",
            "type": "string"
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street Number"
          },
          "postcode": {
            "title": "Postcode",
            "type": "string"
          },
          "city": {
            "title": "City",
            "type": "string"
          },
          "province": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Province"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "it": {
            "$ref": "#/components/schemas/IssuerIt"
          }
        },
        "required": [
          "country",
          "legal_name",
          "vat_country",
          "vat_number",
          "fiscal_code",
          "street",
          "street_number",
          "postcode",
          "city",
          "province",
          "email",
          "phone",
          "it"
        ],
        "title": "Issuer",
        "type": "object"
      },
      "IssuerIn": {
        "description": "I dati fiscali dell'azienda che emette i documenti. Si mandano tutti: i campi assenti si svuotano.",
        "properties": {
          "country": {
            "description": "Paese, due lettere maiuscole (IT).",
            "pattern": "^[A-Z]{2}$",
            "title": "Country",
            "type": "string"
          },
          "legal_name": {
            "description": "Ragione sociale.",
            "maxLength": 80,
            "minLength": 1,
            "title": "Legal Name",
            "type": "string"
          },
          "vat_country": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9]{1,28}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Partita IVA, senza il prefisso del paese.",
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "pattern": "^[A-Z0-9]{11,16}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Fiscal Code"
          },
          "street": {
            "title": "Street",
            "type": "string"
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street Number"
          },
          "postcode": {
            "title": "Postcode",
            "type": "string"
          },
          "city": {
            "title": "City",
            "type": "string"
          },
          "province": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Sigla della provincia (GE).",
            "title": "Province"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Phone"
          },
          "it": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IssuerItIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": [
          "country",
          "legal_name",
          "street",
          "postcode",
          "city"
        ],
        "title": "IssuerIn",
        "type": "object"
      },
      "IssuerIt": {
        "additionalProperties": false,
        "properties": {
          "regime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime"
          },
          "rea_office": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rea Office"
          },
          "rea_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rea Number"
          },
          "share_capital_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share Capital Cents"
          },
          "sole_shareholder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sole Shareholder"
          },
          "in_liquidation": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Liquidation"
          }
        },
        "required": [
          "regime",
          "rea_office",
          "rea_number",
          "share_capital_cents",
          "sole_shareholder",
          "in_liquidation"
        ],
        "title": "IssuerIt",
        "type": "object"
      },
      "IssuerItIn": {
        "description": "Dati italiani dell'azienda per la fattura elettronica.",
        "properties": {
          "regime": {
            "anyOf": [
              {
                "pattern": "^RF[0-9]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Regime fiscale (RF01 ordinario, RF19 forfettario, ...). Se manca, RF01.",
            "title": "Regime"
          },
          "rea_office": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Sigla della provincia dell'ufficio REA.",
            "title": "Rea Office"
          },
          "rea_number": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Rea Number"
          },
          "share_capital_cents": {
            "anyOf": [
              {
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Capitale sociale, in centesimi.",
            "title": "Share Capital Cents"
          },
          "sole_shareholder": {
            "anyOf": [
              {
                "enum": [
                  "SU",
                  "SM"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "SU socio unico, SM più soci.",
            "title": "Sole Shareholder"
          },
          "in_liquidation": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "In Liquidation"
          }
        },
        "title": "IssuerItIn",
        "type": "object"
      },
      "LedgerQuery": {
        "properties": {
          "period": {
            "anyOf": [
              {
                "pattern": "^\\d{4}(-(0[1-9]|1[0-2])|-Q[1-4])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Un mese (AAAA-MM), un trimestre (AAAA-Qn) o un anno (AAAA). In alternativa `from` e `to`, mai insieme.",
            "title": "Period"
          },
          "from": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il primo giorno, AAAA-MM-GG, quando manca `period`.",
            "title": "From"
          },
          "to": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "L'ultimo giorno compreso, AAAA-MM-GG, quando manca `period`; al massimo 400 giorni dopo `from`.",
            "title": "To"
          }
        },
        "title": "LedgerQuery",
        "type": "object"
      },
      "Line": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "line_no": {
            "title": "Line No",
            "type": "integer"
          },
          "variant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant Id"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "quantity": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Quantity",
            "type": "string"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "unit_price": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Unit Price",
            "type": "string"
          },
          "unit_net_price": {
            "description": "Prezzo unitario IVA esclusa, dopo lo sconto.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Unit Net Price",
            "type": "string"
          },
          "discount_percent": {
            "anyOf": [
              {
                "description": "Numero decimale come testo, senza arrotondamenti.",
                "pattern": "^-?\\d+(\\.\\d+)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Percent"
          },
          "tax_rate": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Tax Rate",
            "type": "string"
          },
          "exemption_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exemption Code"
          },
          "net_cents": {
            "description": "In centesimi di euro.",
            "title": "Net Cents",
            "type": "integer"
          },
          "source_line_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La riga del documento da cui viene.",
            "title": "Source Line Id"
          }
        },
        "required": [
          "id",
          "line_no",
          "variant_id",
          "code",
          "description",
          "quantity",
          "unit",
          "unit_price",
          "unit_net_price",
          "discount_percent",
          "tax_rate",
          "exemption_code",
          "net_cents",
          "source_line_id"
        ],
        "title": "Line",
        "type": "object"
      },
      "LineIn": {
        "properties": {
          "description": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "quantity": {
            "description": "Diversa da zero; negativa per uno storno.",
            "examples": [
              "1.50",
              22
            ],
            "title": "Quantity",
            "type": [
              "string",
              "number"
            ]
          },
          "unit_price": {
            "description": "Prezzo unitario, IVA inclusa o esclusa secondo `prices_include_tax` del documento; fino a 8 decimali.",
            "examples": [
              "1.50",
              22
            ],
            "title": "Unit Price",
            "type": [
              "string",
              "number"
            ]
          },
          "tax_rate": {
            "description": "Aliquota IVA, da 0 a meno di 100 (22, 10, 4). Con 0 serve `exemption_code`.",
            "examples": [
              "1.50",
              22
            ],
            "title": "Tax Rate",
            "type": [
              "string",
              "number"
            ]
          },
          "exemption_code": {
            "anyOf": [
              {
                "maxLength": 4,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Natura dell'esenzione (N2.1, N4, ...).",
            "title": "Exemption Code"
          },
          "discount_percent": {
            "anyOf": [
              {
                "examples": [
                  "1.50",
                  22
                ],
                "type": [
                  "string",
                  "number"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Sconto in percentuale, maggiore di 0 e minore di 100.",
            "title": "Discount Percent"
          },
          "code": {
            "anyOf": [
              {
                "maxLength": 35,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il tuo codice articolo.",
            "title": "Code"
          },
          "unit": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Unità di misura (pz, kg).",
            "title": "Unit"
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_price",
          "tax_rate"
        ],
        "title": "LineIn",
        "type": "object"
      },
      "MethodTotal": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "cents": {
            "description": "Quello che il metodo ha incassato davvero (i contanti senza il resto).",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "cents"
        ],
        "title": "MethodTotal",
        "type": "object"
      },
      "ModePrices": {
        "additionalProperties": false,
        "properties": {
          "counter": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Counter"
          },
          "table": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table"
          },
          "takeaway": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Takeaway"
          },
          "delivery": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery"
          }
        },
        "required": [
          "counter",
          "table",
          "takeaway",
          "delivery"
        ],
        "title": "ModePrices",
        "type": "object"
      },
      "MoveIn": {
        "additionalProperties": false,
        "properties": {
          "to": {
            "description": "Il tavolo, come nella pianta (`id`).",
            "pattern": "^[A-Za-z0-9_\\-]{1,40}$",
            "title": "To",
            "type": "string"
          },
          "version": {
            "description": "La `version` del tavolo che hai letto: se è cambiato nel frattempo non succede niente (409 table_changed).",
            "minimum": 0,
            "title": "Version",
            "type": "integer"
          },
          "merge": {
            "default": false,
            "description": "Unisci a un tavolo già occupato (di base è rifiutato).",
            "title": "Merge",
            "type": "boolean"
          }
        },
        "required": [
          "to",
          "version"
        ],
        "title": "MoveIn",
        "type": "object"
      },
      "Moved": {
        "additionalProperties": false,
        "properties": {
          "table": {
            "$ref": "#/components/schemas/Table"
          },
          "warnings": {
            "description": "Quello che l'iPad avrebbe stampato e non è uscito (comanda, storno, avvisi): la scrittura resta fatta, qualcuno avvisa a voce.",
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          },
          "source": {
            "$ref": "#/components/schemas/Table",
            "description": "Il tavolo di partenza, adesso libero."
          }
        },
        "required": [
          "table",
          "warnings",
          "source"
        ],
        "title": "Moved",
        "type": "object"
      },
      "NumberPageQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                "pattern": "^[1-9][0-9]{0,17}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "After"
          }
        },
        "title": "NumberPageQuery",
        "type": "object"
      },
      "OpenCard": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code_end": {
            "description": "Le ultime quattro cifre del codice: il codice intero non esce mai dalla porta.",
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "description": "Dove è stata venduta: banco, shopify, azienda.",
            "title": "Channel",
            "type": "string"
          },
          "price_cents": {
            "description": "Quanto è stata pagata.",
            "title": "Price Cents",
            "type": "integer"
          },
          "face_cents": {
            "description": "Il valore alla vendita, con il bonus.",
            "title": "Face Cents",
            "type": "integer"
          },
          "sold_on": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sold On"
          },
          "expires_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expires On",
            "type": "string"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il riferimento dello scontrino di vendita.",
            "title": "Receipt"
          },
          "balance": {
            "$ref": "#/components/schemas/Amount",
            "description": "Il saldo alla fine del giorno, in pagato e in valore."
          },
          "club_bound": {
            "description": "Legata a una tessera del Club.",
            "title": "Club Bound",
            "type": "boolean"
          },
          "in_app": {
            "description": "Aggiunta nell'app dei clienti.",
            "title": "In App",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "code_end",
          "channel",
          "price_cents",
          "face_cents",
          "sold_on",
          "expires_on",
          "receipt",
          "balance",
          "club_bound",
          "in_app"
        ],
        "title": "OpenCard",
        "type": "object"
      },
      "OpenCards": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "At",
            "type": "string"
          },
          "cards": {
            "description": "Dalla più vicina alla scadenza.",
            "items": {
              "$ref": "#/components/schemas/OpenCard"
            },
            "title": "Cards",
            "type": "array"
          },
          "total": {
            "$ref": "#/components/schemas/Amount",
            "description": "La somma dei saldi: è il debito di quel giorno."
          }
        },
        "required": [
          "at",
          "cards",
          "total"
        ],
        "title": "OpenCards",
        "type": "object"
      },
      "OpenCardsQuery": {
        "properties": {
          "at": {
            "description": "Il giorno: le carte con saldo alla fine di quel giorno.",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "At",
            "type": "string"
          }
        },
        "required": [
          "at"
        ],
        "title": "OpenCardsQuery",
        "type": "object"
      },
      "OperatorTotal": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "documents": {
            "title": "Documents",
            "type": "integer"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "documents",
          "cents"
        ],
        "title": "OperatorTotal",
        "type": "object"
      },
      "Option": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il supplemento al banco del listino di tutti i giorni; vuoto se non costa niente.",
            "title": "Price Cents"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "price_cents"
        ],
        "title": "Option",
        "type": "object"
      },
      "OptionGroup": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "min_choices": {
            "description": "Quante scelte servono almeno.",
            "title": "Min Choices",
            "type": "integer"
          },
          "max_choices": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quante al massimo; vuoto, senza limite.",
            "title": "Max Choices"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/Option"
            },
            "title": "Options",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "min_choices",
          "max_choices",
          "options"
        ],
        "title": "OptionGroup",
        "type": "object"
      },
      "Overview": {
        "additionalProperties": false,
        "description": "I numeri della Panoramica del gestionale: solo la strada di servizio, nel giorno del locale.",
        "properties": {
          "at": {
            "description": "Il momento del calcolo.",
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "today": {
            "$ref": "#/components/schemas/Window"
          },
          "yesterday_same_time": {
            "$ref": "#/components/schemas/Window",
            "description": "Ieri fino alla stessa ora."
          },
          "hours": {
            "description": "Ora per ora oggi, dalle 7 alle 19 più le ore fuori con vendite.",
            "items": {
              "$ref": "#/components/schemas/Hour"
            },
            "title": "Hours",
            "type": "array"
          },
          "payments": {
            "description": "Come si è pagato oggi.",
            "items": {
              "$ref": "#/components/schemas/PayShare"
            },
            "title": "Payments",
            "type": "array"
          },
          "unclosed_days": {
            "description": "Giorni degli ultimi otto con vendite e senza chiusura stampata.",
            "items": {
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            },
            "title": "Unclosed Days",
            "type": "array"
          },
          "any_sales": {
            "description": "Se la cassa ha mai venduto in servizio.",
            "title": "Any Sales",
            "type": "boolean"
          }
        },
        "required": [
          "at",
          "today",
          "yesterday_same_time",
          "hours",
          "payments",
          "unclosed_days",
          "any_sales"
        ],
        "title": "Overview",
        "type": "object"
      },
      "PageQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                "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": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "After"
          }
        },
        "title": "PageQuery",
        "type": "object"
      },
      "Party": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "company o person.",
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name"
          },
          "vat_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscal Code"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street"
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street Number"
          },
          "postcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postcode"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "province": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Province"
          },
          "country": {
            "title": "Country",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "is_customer": {
            "description": "È un cliente.",
            "title": "Is Customer",
            "type": "boolean"
          },
          "is_supplier": {
            "description": "È un fornitore.",
            "title": "Is Supplier",
            "type": "boolean"
          },
          "it": {
            "$ref": "#/components/schemas/PartyIt",
            "description": "Dove riceve le fatture elettroniche."
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "first_name",
          "last_name",
          "vat_country",
          "vat_number",
          "fiscal_code",
          "street",
          "street_number",
          "postcode",
          "city",
          "province",
          "country",
          "email",
          "phone",
          "is_customer",
          "is_supplier",
          "it"
        ],
        "title": "Party",
        "type": "object"
      },
      "PartyIn": {
        "description": "Un cliente o un fornitore. Una partita IVA (o un codice fiscale) vale un soggetto solo: il secondo risponde\n409 `duplicate` con l'`id` di quello che c'è.",
        "properties": {
          "first_name": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Obbligatorio per una persona.",
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Obbligatorio per una persona.",
            "title": "Last Name"
          },
          "vat_country": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Va insieme a vat_number.",
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9]{1,28}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "pattern": "^[A-Z0-9]{11,16}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Fiscal Code"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street"
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street Number"
          },
          "postcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Postcode"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "City"
          },
          "province": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Province"
          },
          "country": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Se manca, IT.",
            "title": "Country"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Phone"
          },
          "is_customer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Customer"
          },
          "is_supplier": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Supplier"
          },
          "it": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartyItIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "kind": {
            "description": "company per un'azienda, person per una persona.",
            "enum": [
              "company",
              "person"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "description": "Ragione sociale, o nome e cognome.",
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "name"
        ],
        "title": "PartyIn",
        "type": "object"
      },
      "PartyIt": {
        "additionalProperties": false,
        "properties": {
          "sdi_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sdi Code"
          },
          "pec": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pec"
          }
        },
        "required": [
          "sdi_code",
          "pec"
        ],
        "title": "PartyIt",
        "type": "object"
      },
      "PartyItIn": {
        "properties": {
          "sdi_code": {
            "anyOf": [
              {
                "pattern": "^[A-Z0-9]{6,7}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Codice destinatario SDI (7 caratteri; 0000000 se riceve via PEC).",
            "title": "Sdi Code"
          },
          "pec": {
            "anyOf": [
              {
                "pattern": "^[^@\\s]+@[^@\\s]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Pec"
          }
        },
        "title": "PartyItIn",
        "type": "object"
      },
      "PartyPatch": {
        "description": "Si cambiano solo i campi mandati.",
        "properties": {
          "first_name": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Obbligatorio per una persona.",
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "maxLength": 60,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Obbligatorio per una persona.",
            "title": "Last Name"
          },
          "vat_country": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Va insieme a vat_number.",
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9]{1,28}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "pattern": "^[A-Z0-9]{11,16}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Fiscal Code"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street"
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street Number"
          },
          "postcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Postcode"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "City"
          },
          "province": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Province"
          },
          "country": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Se manca, IT.",
            "title": "Country"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Phone"
          },
          "is_customer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Customer"
          },
          "is_supplier": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Is Supplier"
          },
          "it": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartyItIn"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "company",
                  "person"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Kind"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          }
        },
        "title": "PartyPatch",
        "type": "object"
      },
      "PartyQuery": {
        "properties": {
          "q": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Cerca nel nome, o una partita IVA o un codice fiscale esatti. Si usano i primi 80 caratteri; al massimo 50 risultati.",
            "title": "Q"
          }
        },
        "title": "PartyQuery",
        "type": "object"
      },
      "PartySummary": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "company o person.",
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "vat_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Country"
          },
          "vat_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Number"
          },
          "fiscal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscal Code"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "is_customer": {
            "title": "Is Customer",
            "type": "boolean"
          },
          "is_supplier": {
            "title": "Is Supplier",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "vat_country",
          "vat_number",
          "fiscal_code",
          "city",
          "is_customer",
          "is_supplier"
        ],
        "title": "PartySummary",
        "type": "object"
      },
      "PayShare": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "enum": [
              "card",
              "cash",
              "other"
            ],
            "title": "Key",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "share": {
            "description": "In percento: le quote fanno sempre 100.",
            "title": "Share",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "name",
          "cents",
          "share"
        ],
        "title": "PayShare",
        "type": "object"
      },
      "Payment": {
        "additionalProperties": false,
        "properties": {
          "method": {
            "description": "Il codice del metodo (contanti, carta, ...).",
            "title": "Method",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il nome del metodo come l'ha visto la cassa.",
            "title": "Name"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il tipo fiscale registrato dalla cassa (contanti, elettronico, ...).",
            "title": "Kind"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          }
        },
        "required": [
          "method",
          "name",
          "kind",
          "cents"
        ],
        "title": "Payment",
        "type": "object"
      },
      "PaymentMethod": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "description": "Il codice che la cassa scrive su ogni pagamento.",
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "fiscal_type": {
            "description": "Come lo registra la stampante fiscale: cash contanti, electronic elettronico, ticket buono pasto, not_collected non riscosso, other altro.",
            "enum": [
              "cash",
              "electronic",
              "ticket",
              "not_collected",
              "other"
            ],
            "title": "Fiscal Type",
            "type": "string"
          },
          "opens_drawer": {
            "title": "Opens Drawer",
            "type": "boolean"
          },
          "sort": {
            "title": "Sort",
            "type": "integer"
          },
          "printers": {
            "description": "Il numero del pagamento sulla stampante di ogni sede.",
            "items": {
              "$ref": "#/components/schemas/SitePrinter"
            },
            "title": "Printers",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "fiscal_type",
          "opens_drawer",
          "sort",
          "printers"
        ],
        "title": "PaymentMethod",
        "type": "object"
      },
      "PaymentMethodIn": {
        "properties": {
          "name": {
            "maxLength": 40,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,29}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Lo scrive la cassa su ogni pagamento e poi non cambia. Se manca, nasce dal nome.",
            "title": "Code"
          },
          "fiscal_type": {
            "description": "Come lo registra la stampante fiscale; poi non cambia.",
            "enum": [
              "cash",
              "electronic",
              "ticket",
              "not_collected",
              "other"
            ],
            "title": "Fiscal Type",
            "type": "string"
          },
          "opens_drawer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Se manca: sì per i contanti, no per gli altri.",
            "title": "Opens Drawer"
          },
          "sort": {
            "default": 0,
            "maximum": 9999,
            "minimum": 0,
            "title": "Sort",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "fiscal_type"
        ],
        "title": "PaymentMethodIn",
        "type": "object"
      },
      "PaymentMethodPage": {
        "additionalProperties": false,
        "description": "Una pagina di metodi di pagamento.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/PaymentMethod"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "PaymentMethodPage",
        "type": "object"
      },
      "PaymentMethodPatch": {
        "description": "Si cambiano nome, cassetto e ordine; codice e tipo fiscale restano quelli della creazione.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "opens_drawer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Opens Drawer"
          },
          "sort": {
            "anyOf": [
              {
                "maximum": 9999,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Sort"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Solo se uguale a quello di oggi.",
            "title": "Code"
          },
          "fiscal_type": {
            "anyOf": [
              {
                "enum": [
                  "cash",
                  "electronic",
                  "ticket",
                  "not_collected",
                  "other"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Solo se uguale a quello di oggi.",
            "title": "Fiscal Type"
          }
        },
        "title": "PaymentMethodPatch",
        "type": "object"
      },
      "PeriodQuery": {
        "properties": {
          "from": {
            "description": "Il primo giorno, AAAA-MM-GG.",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "From",
            "type": "string"
          },
          "to": {
            "description": "L'ultimo giorno compreso, AAAA-MM-GG; al massimo 400 giorni dopo `from`.",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "To",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "title": "PeriodQuery",
        "type": "object"
      },
      "PriceIn": {
        "properties": {
          "price_cents": {
            "description": "In centesimi di euro, IVA compresa: da 0 a 100.000 euro.",
            "maximum": 10000000,
            "minimum": 0,
            "title": "Price Cents",
            "type": "integer"
          }
        },
        "required": [
          "price_cents"
        ],
        "title": "PriceIn",
        "type": "object"
      },
      "PriceList": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "base_list_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il listino da cui prende i prezzi che non dice.",
            "title": "Base List Id"
          },
          "prices_include_vat": {
            "title": "Prices Include Vat",
            "type": "boolean"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "valid_from": {
            "title": "Valid From",
            "type": "string"
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To"
          },
          "is_main": {
            "description": "Il listino di tutti i giorni: vale dove un altro non dice il prezzo.",
            "title": "Is Main",
            "type": "boolean"
          },
          "at_till": {
            "description": "Si sceglie dal menu della cassa.",
            "title": "At Till",
            "type": "boolean"
          },
          "room_default": {
            "description": "Apre i conti al tavolo.",
            "title": "Room Default",
            "type": "boolean"
          },
          "own_prices": {
            "description": "Quante varianti hanno un prezzo scritto in questo listino.",
            "title": "Own Prices",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "base_list_id",
          "prices_include_vat",
          "currency",
          "valid_from",
          "valid_to",
          "is_main",
          "at_till",
          "room_default",
          "own_prices"
        ],
        "title": "PriceList",
        "type": "object"
      },
      "PriceListIn": {
        "properties": {
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "description": "Lettere, numeri e trattini; si scrive in minuscolo. Se manca, nasce dal nome.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Code"
          },
          "base_list_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il listino da cui prende i prezzi che non dice.",
            "title": "Base List Id"
          },
          "at_till": {
            "default": false,
            "description": "Si sceglie dal menu della cassa.",
            "title": "At Till",
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "title": "PriceListIn",
        "type": "object"
      },
      "PriceListPage": {
        "additionalProperties": false,
        "description": "Una pagina di listini.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/PriceList"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "PriceListPage",
        "type": "object"
      },
      "PriceListPatch": {
        "description": "Si cambiano solo i campi che mandi. Il codice resta: è sulle righe già vendute.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "base_list_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "`null`: non si appoggia a nessun listino.",
            "title": "Base List Id"
          },
          "at_till": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "At Till"
          },
          "room_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Apre i conti al tavolo (uno solo: lo toglie agli altri).",
            "title": "Room Default"
          },
          "is_main": {
            "anyOf": [
              {
                "const": true,
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Lo fa diventare il listino di tutti i giorni (quello di prima resta alla cassa).",
            "title": "Is Main"
          }
        },
        "title": "PriceListPatch",
        "type": "object"
      },
      "PriceQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
                "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": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "After"
          },
          "q": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Cerca nel nome e nel codice dell'articolo.",
            "title": "Q"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Le righe di una categoria.",
            "title": "Category Id"
          }
        },
        "title": "PriceQuery",
        "type": "object"
      },
      "PriceRow": {
        "additionalProperties": false,
        "properties": {
          "variant_id": {
            "format": "uuid",
            "title": "Variant Id",
            "type": "string"
          },
          "article_id": {
            "format": "uuid",
            "title": "Article Id",
            "type": "string"
          },
          "article": {
            "title": "Article",
            "type": "string"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant"
          },
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Id"
          },
          "own_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il prezzo scritto in questo listino; vuoto se lo prende da un altro.",
            "title": "Own Cents"
          },
          "prices": {
            "$ref": "#/components/schemas/ModePrices",
            "description": "Il prezzo che vale per modo di vendita, IVA compresa: counter al banco, table al tavolo, takeaway da asporto, delivery a domicilio."
          }
        },
        "required": [
          "variant_id",
          "article_id",
          "article",
          "variant",
          "category_id",
          "own_cents",
          "prices"
        ],
        "title": "PriceRow",
        "type": "object"
      },
      "PriceRowPage": {
        "additionalProperties": false,
        "description": "Una pagina di righe di prezzo.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/PriceRow"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "PriceRowPage",
        "type": "object"
      },
      "PricesIn": {
        "additionalProperties": false,
        "properties": {
          "version": {
            "description": "La `version` del tavolo che hai letto: se è cambiato nel frattempo non succede niente (409 table_changed).",
            "minimum": 0,
            "title": "Version",
            "type": "integer"
          },
          "price_list": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il listino di arrivo; se manca, quello della sala.",
            "title": "Price List"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "description": "Un UUID scelto da chi manda la riga: rimandare la stessa riga non la aggiunge due volte.",
                  "pattern": "^[A-Fa-f0-9\\-]{36}$",
                  "type": "string"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Solo queste righe, ciascuna sul suo listino (una Fidelity fra amici); se manca, tutto il conto.",
            "title": "Lines"
          }
        },
        "required": [
          "version"
        ],
        "title": "PricesIn",
        "type": "object"
      },
      "PrinterIn": {
        "description": "Il numero sulla stampante fiscale di una sede. Un numero già impostato si cambia solo con `confirm: true`.",
        "properties": {
          "site": {
            "description": "La sede (vedi `/sites`).",
            "title": "Site",
            "type": "integer"
          },
          "number": {
            "anyOf": [
              {
                "maximum": 99,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reparti da 1 a 99, pagamenti da 0 a 99; `null` lo toglie.",
            "title": "Number"
          },
          "confirm": {
            "default": false,
            "title": "Confirm",
            "type": "boolean"
          }
        },
        "required": [
          "site",
          "number"
        ],
        "title": "PrinterIn",
        "type": "object"
      },
      "Queued": {
        "additionalProperties": false,
        "properties": {
          "command": {
            "description": "Il comando lasciato al punto d'appoggio: si rilegge con /table_commands/{id}.",
            "title": "Command",
            "type": "integer"
          },
          "state": {
            "description": "queued in attesa; taken preso dal punto d'appoggio, in corso.",
            "enum": [
              "queued",
              "taken"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "command",
          "state"
        ],
        "title": "Queued",
        "type": "object"
      },
      "Receipt": {
        "additionalProperties": false,
        "properties": {
          "ref": {
            "title": "Ref",
            "type": "string"
          },
          "number": {
            "title": "Number",
            "type": "integer"
          },
          "date": {
            "title": "Date",
            "type": "string"
          }
        },
        "required": [
          "ref",
          "number",
          "date"
        ],
        "title": "Receipt",
        "type": "object"
      },
      "ReceiptIn": {
        "description": "Lo scontrino che la fattura segue (fattura chiesta al banco): uno scontrino fa una fattura sola.",
        "properties": {
          "ref": {
            "description": "Matricola del registratore.",
            "maxLength": 60,
            "minLength": 1,
            "title": "Ref",
            "type": "string"
          },
          "number": {
            "minimum": 1,
            "title": "Number",
            "type": "integer"
          },
          "date": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date",
            "type": "string"
          }
        },
        "required": [
          "ref",
          "number",
          "date"
        ],
        "title": "ReceiptIn",
        "type": "object"
      },
      "RedeemedSoon": {
        "additionalProperties": false,
        "properties": {
          "card": {
            "title": "Card",
            "type": "integer"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "sold_at": {
            "format": "date-time",
            "title": "Sold At",
            "type": "string"
          },
          "redeemed_at": {
            "format": "date-time",
            "title": "Redeemed At",
            "type": "string"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Receipt"
          },
          "device": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Device"
          }
        },
        "required": [
          "card",
          "code_end",
          "channel",
          "sold_at",
          "redeemed_at",
          "cents",
          "receipt",
          "device"
        ],
        "title": "RedeemedSoon",
        "type": "object"
      },
      "RefundRow": {
        "additionalProperties": false,
        "properties": {
          "card": {
            "title": "Card",
            "type": "integer"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Receipt"
          },
          "by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "By"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "at": {
            "format": "date-time",
            "title": "At",
            "type": "string"
          }
        },
        "required": [
          "card",
          "code_end",
          "channel",
          "cents",
          "receipt",
          "by",
          "reason",
          "at"
        ],
        "title": "RefundRow",
        "type": "object"
      },
      "Related": {
        "additionalProperties": false,
        "properties": {
          "number_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number Text"
          },
          "issue_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          }
        },
        "required": [
          "number_text",
          "issue_date"
        ],
        "title": "Related",
        "type": "object"
      },
      "RemoveIn": {
        "additionalProperties": false,
        "properties": {
          "line": {
            "description": "Un UUID scelto da chi manda la riga: rimandare la stessa riga non la aggiunge due volte.",
            "pattern": "^[A-Fa-f0-9\\-]{36}$",
            "title": "Line",
            "type": "string"
          },
          "qty": {
            "description": "Quanti pezzi della riga togliere.",
            "maximum": 99,
            "minimum": 1,
            "title": "Qty",
            "type": "integer"
          },
          "version": {
            "description": "La `version` del tavolo che hai letto: se è cambiato nel frattempo non succede niente (409 table_changed).",
            "minimum": 0,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "line",
          "qty",
          "version"
        ],
        "title": "RemoveIn",
        "type": "object"
      },
      "ReportCard": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "face_cents": {
            "description": "In centesimi di euro.",
            "title": "Face Cents",
            "type": "integer"
          },
          "balance_cents": {
            "description": "Il saldo alla fine del periodo.",
            "title": "Balance Cents",
            "type": "integer"
          },
          "sold_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Sold On",
            "type": "string"
          },
          "expires_on": {
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expires On",
            "type": "string"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Receipt"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ref"
          }
        },
        "required": [
          "id",
          "code_end",
          "channel",
          "face_cents",
          "balance_cents",
          "sold_on",
          "expires_on",
          "receipt",
          "ref"
        ],
        "title": "ReportCard",
        "type": "object"
      },
      "Reprice": {
        "additionalProperties": false,
        "properties": {
          "applied": {
            "description": "Falso: è solo l'anteprima.",
            "title": "Applied",
            "type": "boolean"
          },
          "changes": {
            "items": {
              "$ref": "#/components/schemas/RepriceChange"
            },
            "title": "Changes",
            "type": "array"
          }
        },
        "required": [
          "applied",
          "changes"
        ],
        "title": "Reprice",
        "type": "object"
      },
      "RepriceChange": {
        "additionalProperties": false,
        "properties": {
          "variant_id": {
            "format": "uuid",
            "title": "Variant Id",
            "type": "string"
          },
          "article": {
            "title": "Article",
            "type": "string"
          },
          "old_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Old Cents"
          },
          "new_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Cents"
          }
        },
        "required": [
          "variant_id",
          "article",
          "old_cents",
          "new_cents"
        ],
        "title": "RepriceChange",
        "type": "object"
      },
      "RepriceIn": {
        "description": "Cambia molti prezzi di un listino per percentuale: gli articoli indicati, altrimenti le categorie, altrimenti\ntutti quelli con un prezzo. I supplementi restano come sono.",
        "properties": {
          "percent": {
            "description": "Da -90 a 300, al centesimo, non zero: 10 aumenta del 10%, -5 sconta del 5%.",
            "examples": [
              "1.50",
              22
            ],
            "title": "Percent",
            "type": [
              "string",
              "number"
            ]
          },
          "round_to_cents": {
            "default": 1,
            "description": "A quanti centesimi arrotondare; mai a zero.",
            "enum": [
              1,
              5,
              10,
              50,
              100
            ],
            "title": "Round To Cents",
            "type": "integer"
          },
          "category_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "maxItems": 1000,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Category Ids"
          },
          "article_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "maxItems": 1000,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Article Ids"
          },
          "apply": {
            "default": false,
            "description": "Senza `true` dice solo cosa cambierebbe, senza cambiare niente.",
            "title": "Apply",
            "type": "boolean"
          }
        },
        "required": [
          "percent"
        ],
        "title": "RepriceIn",
        "type": "object"
      },
      "Retired": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "retired": {
            "description": "Ritirato: non si usa più, la sua storia resta.",
            "title": "Retired",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "retired"
        ],
        "title": "Retired",
        "type": "object"
      },
      "Room": {
        "additionalProperties": false,
        "properties": {
          "works_on": {
            "description": "Dove lavora la sala adesso: hub il punto d'appoggio del locale (il server ne ha una copia, al massimo qualche secondo indietro); server il server della cassa.",
            "enum": [
              "hub",
              "server"
            ],
            "title": "Works On",
            "type": "string"
          },
          "hub_seen_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultimo segnale del punto d'appoggio, se il locale ne ha uno.",
            "title": "Hub Seen At"
          }
        },
        "required": [
          "works_on",
          "hub_seen_at"
        ],
        "title": "Room",
        "type": "object"
      },
      "RoomSettings": {
        "additionalProperties": false,
        "properties": {
          "ask_free_after_pay": {
            "description": "Dopo l'incasso l'iPad chiede se liberare il tavolo o lasciarlo «Pagato».",
            "title": "Ask Free After Pay",
            "type": "boolean"
          },
          "assign_table_after_counter_pay": {
            "description": "Dopo un incasso al banco l'iPad chiede a che tavolo portarlo.",
            "title": "Assign Table After Counter Pay",
            "type": "boolean"
          }
        },
        "required": [
          "ask_free_after_pay",
          "assign_table_after_counter_pay"
        ],
        "title": "RoomSettings",
        "type": "object"
      },
      "RoomSettingsIn": {
        "additionalProperties": false,
        "properties": {
          "ask_free_after_pay": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ask Free After Pay"
          },
          "assign_table_after_counter_pay": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Assign Table After Counter Pay"
          }
        },
        "title": "RoomSettingsIn",
        "type": "object"
      },
      "SeatIn": {
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "description": "Lo scontrino già uscito al banco: due volte lo stesso è un cliente solo.",
            "maxLength": 40,
            "minLength": 1,
            "title": "Receipt",
            "type": "string"
          },
          "items": {
            "description": "Cosa ha pagato: un promemoria sul tavolo, mai nel conto.",
            "items": {
              "$ref": "#/components/schemas/SeatItem"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "receipt",
          "items"
        ],
        "title": "SeatIn",
        "type": "object"
      },
      "SeatItem": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "qty": {
            "maximum": 99,
            "minimum": 1,
            "title": "Qty",
            "type": "integer"
          },
          "options": {
            "items": {
              "maxLength": 40,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "title": "Options",
            "type": "array"
          },
          "note": {
            "default": "",
            "maxLength": 60,
            "title": "Note",
            "type": "string"
          },
          "no_comanda": {
            "default": false,
            "description": "Già consegnato al banco.",
            "title": "No Comanda",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "qty"
        ],
        "title": "SeatItem",
        "type": "object"
      },
      "Seated": {
        "additionalProperties": false,
        "properties": {
          "table": {
            "$ref": "#/components/schemas/Table"
          },
          "warnings": {
            "description": "Quello che l'iPad avrebbe stampato e non è uscito (comanda, storno, avvisi): la scrittura resta fatta, qualcuno avvisa a voce.",
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          },
          "already": {
            "description": "Lo stesso scontrino era già sul tavolo: niente di nuovo.",
            "title": "Already",
            "type": "boolean"
          }
        },
        "required": [
          "table",
          "warnings",
          "already"
        ],
        "title": "Seated",
        "type": "object"
      },
      "SeatedPaid": {
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "description": "Lo scontrino del banco.",
            "title": "Receipt",
            "type": "string"
          },
          "items": {
            "description": "Cosa ha pagato al banco: nome, quantità, varianti, nota.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Items",
            "type": "array"
          },
          "at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "At"
          },
          "by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "By"
          }
        },
        "required": [
          "receipt",
          "items",
          "at",
          "by"
        ],
        "title": "SeatedPaid",
        "type": "object"
      },
      "SendIn": {
        "additionalProperties": false,
        "properties": {
          "lines": {
            "items": {
              "$ref": "#/components/schemas/SendLine"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Lines",
            "type": "array"
          },
          "price_list": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il listino dei prezzi; se manca, quello principale.",
            "title": "Price List"
          }
        },
        "required": [
          "lines"
        ],
        "title": "SendIn",
        "type": "object"
      },
      "SendLine": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Un UUID scelto da chi manda la riga: rimandare la stessa riga non la aggiunge due volte.",
            "pattern": "^[A-Fa-f0-9\\-]{36}$",
            "title": "Id",
            "type": "string"
          },
          "article": {
            "description": "L'articolo nel catalogo della cassa (`id` di /till_catalog): nome, prezzo, reparto, IVA e postazione li mette la cassa, mai chi chiama.",
            "maxLength": 80,
            "minLength": 1,
            "title": "Article",
            "type": "string"
          },
          "qty": {
            "maximum": 99,
            "minimum": 1,
            "title": "Qty",
            "type": "integer"
          },
          "options": {
            "description": "Le varianti scelte, per `id`, fra quelle dell'articolo.",
            "items": {
              "maxLength": 60,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "title": "Options",
            "type": "array"
          },
          "note": {
            "default": "",
            "maxLength": 60,
            "title": "Note",
            "type": "string"
          },
          "no_comanda": {
            "default": false,
            "description": "Già servita o consegnata: va sul conto, non sulla comanda.",
            "title": "No Comanda",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "article",
          "qty"
        ],
        "title": "SendLine",
        "type": "object"
      },
      "Sent": {
        "additionalProperties": false,
        "properties": {
          "table": {
            "$ref": "#/components/schemas/Table"
          },
          "warnings": {
            "description": "Quello che l'iPad avrebbe stampato e non è uscito (comanda, storno, avvisi): la scrittura resta fatta, qualcuno avvisa a voce.",
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          },
          "added": {
            "description": "Le righe aggiunte adesso: quelle già sul tavolo (stesso `id`) non si ripetono.",
            "title": "Added",
            "type": "integer"
          }
        },
        "required": [
          "table",
          "warnings",
          "added"
        ],
        "title": "Sent",
        "type": "object"
      },
      "Series": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "description": "Codice breve: FT, NC.",
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "kinds": {
            "description": "I tipi di documento che numera.",
            "items": {
              "type": "string"
            },
            "title": "Kinds",
            "type": "array"
          },
          "number_format": {
            "description": "Come si scrive il numero: `{n}` è il progressivo dell'anno.",
            "title": "Number Format",
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "kinds",
          "number_format"
        ],
        "title": "Series",
        "type": "object"
      },
      "SeriesIn": {
        "properties": {
          "code": {
            "description": "Codice breve, unico: FT, NC.",
            "pattern": "^[A-Za-z0-9]{1,10}$",
            "title": "Code",
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "kinds": {
            "description": "I tipi di documento che numera.",
            "items": {
              "enum": [
                "quote",
                "proforma",
                "order",
                "delivery_note",
                "invoice",
                "credit_note",
                "receipt",
                "return",
                "purchase_order",
                "purchase_invoice",
                "self_invoice"
              ],
              "type": "string"
            },
            "minItems": 1,
            "title": "Kinds",
            "type": "array"
          },
          "number_format": {
            "anyOf": [
              {
                "maxLength": 40,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Come si scrive il numero; deve contenere `{n}` (per esempio `FT{n}/2026`). Se manca, `{n}`.",
            "title": "Number Format"
          }
        },
        "required": [
          "code",
          "name",
          "kinds"
        ],
        "title": "SeriesIn",
        "type": "object"
      },
      "Site": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "name"
        ],
        "title": "Site",
        "type": "object"
      },
      "SitePage": {
        "additionalProperties": false,
        "description": "Una pagina di sedi.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/Site"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "SitePage",
        "type": "object"
      },
      "SitePrinter": {
        "additionalProperties": false,
        "properties": {
          "site": {
            "description": "La sede (vedi `/sites`).",
            "title": "Site",
            "type": "integer"
          },
          "number": {
            "description": "Il numero sulla stampante fiscale di quella sede.",
            "title": "Number",
            "type": "integer"
          }
        },
        "required": [
          "site",
          "number"
        ],
        "title": "SitePrinter",
        "type": "object"
      },
      "SoldAndVoided": {
        "additionalProperties": false,
        "properties": {
          "card": {
            "title": "Card",
            "type": "integer"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "cents": {
            "description": "In centesimi di euro.",
            "title": "Cents",
            "type": "integer"
          },
          "sold_at": {
            "format": "date-time",
            "title": "Sold At",
            "type": "string"
          },
          "voided_at": {
            "format": "date-time",
            "title": "Voided At",
            "type": "string"
          },
          "voided_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voided By"
          },
          "receipt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Receipt"
          }
        },
        "required": [
          "card",
          "code_end",
          "channel",
          "cents",
          "sold_at",
          "voided_at",
          "voided_by",
          "receipt"
        ],
        "title": "SoldAndVoided",
        "type": "object"
      },
      "Table": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "area": {
            "title": "Area",
            "type": "string"
          },
          "state": {
            "description": "free libero; open aperto con righe da incassare; billed preconto stampato; paying in pagamento su un iPad (nessuno aggiunge o toglie finché non finisce); paid_seated pagato e ancora occupato.",
            "enum": [
              "free",
              "open",
              "billed",
              "paying",
              "paid_seated"
            ],
            "title": "State",
            "type": "string"
          },
          "version": {
            "description": "Cambia a ogni scrittura: le scritture che dipendono da ciò che si è visto lo rimandano (`version`).",
            "title": "Version",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/TableLine"
            },
            "title": "Lines",
            "type": "array"
          },
          "total_cents": {
            "description": "In centesimi di euro.",
            "title": "Total Cents",
            "type": "integer"
          },
          "opened_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opened At"
          },
          "billed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed At"
          },
          "seated_paid_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seated Paid At"
          },
          "seated_paid": {
            "description": "Pagato al banco da chi siede qui: un promemoria, mai nel conto.",
            "items": {
              "$ref": "#/components/schemas/SeatedPaid"
            },
            "title": "Seated Paid",
            "type": "array"
          },
          "lock": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TableLock"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "area",
          "state",
          "version",
          "lines",
          "total_cents",
          "opened_at",
          "billed_at",
          "seated_paid_at",
          "seated_paid",
          "lock"
        ],
        "title": "Table",
        "type": "object"
      },
      "TableCommand": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "table_id": {
            "title": "Table Id",
            "type": "string"
          },
          "state": {
            "description": "queued in attesa; taken in corso; done fatto (vedi `result` o `error`); expired nessuno l'ha preso entro un minuto, non si farà più; unknown preso e mai risposto: rileggi il tavolo.",
            "enum": [
              "queued",
              "taken",
              "done",
              "expired",
              "unknown"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "done_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Done At"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "La risposta della scrittura, come se fosse arrivata subito.",
            "title": "Result"
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommandError"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "table_id",
          "state",
          "created_at",
          "done_at",
          "result",
          "error"
        ],
        "title": "TableCommand",
        "type": "object"
      },
      "TableEvent": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "table_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vuoto per le impostazioni della sala.",
            "title": "Table Id"
          },
          "at": {
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "device": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'iPad, oppure api:<chiave> per una chiave API.",
            "title": "Device"
          },
          "kind": {
            "description": "send, remove, prices, move-in, move-out, lock, unlock, bill, cancel, pay, free, seat, conflict, settings.",
            "title": "Kind",
            "type": "string"
          },
          "detail": {
            "additionalProperties": true,
            "description": "Cosa è successo: righe, chi ha approvato (`approvedBy`; `admin` è una chiave con tables.manage), lo scontrino.",
            "title": "Detail",
            "type": "object"
          },
          "via_hub": {
            "description": "Arrivato dal punto d'appoggio del locale.",
            "title": "Via Hub",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "table_id",
          "at",
          "device",
          "kind",
          "detail",
          "via_hub"
        ],
        "title": "TableEvent",
        "type": "object"
      },
      "TableEvents": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TableEvent"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "TableEvents",
        "type": "object"
      },
      "TableLine": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "article": {
            "description": "L'articolo nel catalogo della cassa (`id` di /till_catalog).",
            "title": "Article",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "qty": {
            "title": "Qty",
            "type": "integer"
          },
          "unit_cents": {
            "description": "Il prezzo di un pezzo, senza le varianti.",
            "title": "Unit Cents",
            "type": "integer"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/TableLineOption"
            },
            "title": "Options",
            "type": "array"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "discount_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Percent"
          },
          "discount_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Cents"
          },
          "total_cents": {
            "description": "La riga intera: pezzi per prezzo con le varianti, meno lo sconto.",
            "title": "Total Cents",
            "type": "integer"
          },
          "station": {
            "description": "La postazione che la prepara: bar, cucina.",
            "title": "Station",
            "type": "string"
          },
          "department": {
            "description": "Il reparto del registratore.",
            "title": "Department",
            "type": "string"
          },
          "vat": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'aliquota IVA, in percento.",
            "title": "Vat"
          },
          "price_list": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price List"
          },
          "no_comanda": {
            "description": "Già servita o consegnata: sul conto, mai sulla comanda.",
            "title": "No Comanda",
            "type": "boolean"
          },
          "sent_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chi l'ha mandata: il cameriere, o il nome della chiave.",
            "title": "Sent By"
          },
          "sent_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da dove: il codice dell'iPad, oppure api:<chiave> per una chiave API.",
            "title": "Sent From"
          }
        },
        "required": [
          "id",
          "article",
          "name",
          "qty",
          "unit_cents",
          "options",
          "note",
          "discount_percent",
          "discount_cents",
          "total_cents",
          "station",
          "department",
          "vat",
          "price_list",
          "no_comanda",
          "sent_by",
          "sent_from"
        ],
        "title": "TableLine",
        "type": "object"
      },
      "TableLineOption": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_cents": {
            "description": "In centesimi di euro.",
            "title": "Price Cents",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "price_cents"
        ],
        "title": "TableLineOption",
        "type": "object"
      },
      "TableLock": {
        "additionalProperties": false,
        "properties": {
          "device": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'iPad che sta incassando.",
            "title": "Device"
          },
          "until": {
            "description": "Quando il blocco scade da solo.",
            "format": "date-time",
            "title": "Until",
            "type": "string"
          }
        },
        "required": [
          "device",
          "until"
        ],
        "title": "TableLock",
        "type": "object"
      },
      "TableQuery": {
        "properties": {
          "all": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Anche i tavoli liberi (di base solo quelli occupati).",
            "title": "All"
          }
        },
        "title": "TableQuery",
        "type": "object"
      },
      "Tables": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Table"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sempre vuoto: la sala sta in una pagina.",
            "title": "Next"
          },
          "room": {
            "$ref": "#/components/schemas/Room"
          }
        },
        "required": [
          "data",
          "next",
          "room"
        ],
        "title": "Tables",
        "type": "object"
      },
      "Tax": {
        "additionalProperties": false,
        "properties": {
          "tax_rate": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Tax Rate",
            "type": "string"
          },
          "exemption_code": {
            "title": "Exemption Code",
            "type": "string"
          },
          "net_cents": {
            "description": "In centesimi di euro.",
            "title": "Net Cents",
            "type": "integer"
          },
          "tax_cents": {
            "description": "In centesimi di euro.",
            "title": "Tax Cents",
            "type": "integer"
          }
        },
        "required": [
          "tax_rate",
          "exemption_code",
          "net_cents",
          "tax_cents"
        ],
        "title": "Tax",
        "type": "object"
      },
      "TillCatalog": {
        "additionalProperties": false,
        "description": "Il catalogo che la cassa ha ricevuto: è quello che gli iPad vendono.",
        "properties": {
          "version": {
            "title": "Version",
            "type": "string"
          },
          "created_at": {
            "description": "Quando è arrivato alla cassa.",
            "title": "Created At",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "body": {
            "additionalProperties": true,
            "description": "Il catalogo come lo legge l'iPad (reparti, categorie, scelte, prodotti coi prezzi in centesimi).",
            "title": "Body",
            "type": "object"
          }
        },
        "required": [
          "version",
          "created_at",
          "note",
          "body"
        ],
        "title": "TillCatalog",
        "type": "object"
      },
      "TillCatalogVersion": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Il numero della pubblicazione.",
            "title": "Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          }
        },
        "required": [
          "id",
          "version",
          "created_at",
          "note"
        ],
        "title": "TillCatalogVersion",
        "type": "object"
      },
      "TillCatalogVersionPage": {
        "additionalProperties": false,
        "description": "Una pagina di versioni del catalogo.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/TillCatalogVersion"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "TillCatalogVersionPage",
        "type": "object"
      },
      "TillDevice": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Il codice dell'iPad: non cambia mai ed è l'inizio dell'id dei suoi scontrini.",
            "title": "Code",
            "type": "string"
          },
          "name": {
            "description": "Il nome che vedono le persone; senza nome, il codice.",
            "title": "Name",
            "type": "string"
          },
          "named": {
            "description": "Se qualcuno gli ha dato un nome.",
            "title": "Named",
            "type": "boolean"
          },
          "site": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TillSite"
              },
              {
                "type": "null"
              }
            ],
            "description": "La sede a cui è collegato."
          },
          "last_seen_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultima volta che ha parlato col server.",
            "title": "Last Seen At"
          },
          "fiscal_roads": {
            "description": "Le strade fiscali che il locale gli apre: D gli scontrini veri, C la prova col tecnico. Vuoto: solo la strada di addestramento, nessuno scontrino fiscale.",
            "items": {
              "enum": [
                "C",
                "D"
              ],
              "type": "string"
            },
            "title": "Fiscal Roads",
            "type": "array"
          }
        },
        "required": [
          "code",
          "name",
          "named",
          "site",
          "last_seen_at",
          "fiscal_roads"
        ],
        "title": "TillDevice",
        "type": "object"
      },
      "TillDevices": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TillDevice"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sempre vuoto: gli iPad stanno in una pagina.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "TillDevices",
        "type": "object"
      },
      "TillFeatures": {
        "additionalProperties": false,
        "properties": {
          "licence": {
            "$ref": "#/components/schemas/TillLicence"
          },
          "invoices": {
            "description": "Fattura al banco (il motore dei documenti è acceso).",
            "title": "Invoices",
            "type": "boolean"
          },
          "club": {
            "description": "Tessera Club sullo scontrino.",
            "title": "Club",
            "type": "boolean"
          },
          "giftcards": {
            "description": "Carte regalo.",
            "title": "Giftcards",
            "type": "boolean"
          }
        },
        "required": [
          "licence",
          "invoices",
          "club",
          "giftcards"
        ],
        "title": "TillFeatures",
        "type": "object"
      },
      "TillLicence": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "description": "Se la cassa è attiva per questa azienda.",
            "title": "Active",
            "type": "boolean"
          },
          "ends_on": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'ultimo giorno della licenza; vuoto se non ha una fine.",
            "title": "Ends On"
          }
        },
        "required": [
          "active",
          "ends_on"
        ],
        "title": "TillLicence",
        "type": "object"
      },
      "TillPageQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          }
        },
        "title": "TillPageQuery",
        "type": "object"
      },
      "TillPeople": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TillPerson"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sempre vuoto: le persone stanno in una pagina.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "TillPeople",
        "type": "object"
      },
      "TillPerson": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "La persona nel nucleo (la stessa su tutte le app della suite).",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "role": {
            "description": "manager responsabile: approva quello che sull'iPad chiede il suo PIN (annulli, resi, chiusure, export); staff cassiere.",
            "enum": [
              "manager",
              "staff"
            ],
            "title": "Role",
            "type": "string"
          },
          "has_pin": {
            "description": "Se ha già scelto il PIN per entrare alla cassa. Il PIN non esce mai.",
            "title": "Has Pin",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "role",
          "has_pin"
        ],
        "title": "TillPerson",
        "type": "object"
      },
      "TillReceipt": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "sale vendita, void annullo, refund reso.",
            "enum": [
              "sale",
              "void",
              "refund"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "enum": [
              "printed",
              "pending",
              "uncertain",
              "failed",
              "not_printed"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "day": {
            "description": "Il giorno nell'ora del locale.",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Day",
            "type": "string"
          },
          "device": {
            "description": "Il codice dell'iPad.",
            "title": "Device",
            "type": "string"
          },
          "device_name": {
            "description": "Il nome dell'iPad per le persone.",
            "title": "Device Name",
            "type": "string"
          },
          "road": {
            "description": "La strada della cassa: D è il servizio vero; le altre sono prova e addestramento (non contano negli incassi della Panoramica).",
            "title": "Road",
            "type": "string"
          },
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La matricola del registratore fiscale.",
            "title": "Serial"
          },
          "z_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero della chiusura fiscale (Z) che lo contiene.",
            "title": "Z Number"
          },
          "receipt_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero dello scontrino nella giornata fiscale.",
            "title": "Receipt Number"
          },
          "order_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero d'ordine chiamato al banco.",
            "title": "Order Number"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chi era alla cassa.",
            "title": "Operator"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il responsabile che ha approvato (annulli e resi).",
            "title": "Approved By"
          },
          "total_cents": {
            "description": "Il totale, IVA compresa, sempre positivo: il tipo dice il verso.",
            "title": "Total Cents",
            "type": "integer"
          },
          "discount_cents": {
            "description": "Lo sconto sul totale del conto (quelli di riga sono sulle righe).",
            "title": "Discount Cents",
            "type": "integer"
          },
          "change_cents": {
            "description": "Il resto dato in contanti.",
            "title": "Change Cents",
            "type": "integer"
          },
          "reverses": {
            "anyOf": [
              {
                "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
                "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per annulli e resi: la vendita che correggono.",
            "title": "Reverses"
          },
          "payments": {
            "items": {
              "$ref": "#/components/schemas/Payment"
            },
            "title": "Payments",
            "type": "array"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La nota dello scontrino.",
            "title": "Note"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/TillReceiptLine"
            },
            "title": "Lines",
            "type": "array"
          },
          "reversed_by": {
            "description": "Gli annulli e i resi che correggono questa vendita.",
            "items": {
              "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
              "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
              "type": "string"
            },
            "title": "Reversed By",
            "type": "array"
          },
          "invoice_requests": {
            "description": "Le richieste di fattura fatte al banco per questo scontrino.",
            "items": {
              "$ref": "#/components/schemas/InvoiceRequest"
            },
            "title": "Invoice Requests",
            "type": "array"
          },
          "club_card": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La tessera Club passata sullo scontrino.",
            "title": "Club Card"
          },
          "club_postings": {
            "description": "Il passaggio dei punti al Club.",
            "items": {
              "$ref": "#/components/schemas/ClubPosting"
            },
            "title": "Club Postings",
            "type": "array"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "day",
          "device",
          "device_name",
          "road",
          "serial",
          "z_number",
          "receipt_number",
          "order_number",
          "operator",
          "approved_by",
          "total_cents",
          "discount_cents",
          "change_cents",
          "reverses",
          "payments",
          "note",
          "lines",
          "reversed_by",
          "invoice_requests",
          "club_card",
          "club_postings"
        ],
        "title": "TillReceipt",
        "type": "object"
      },
      "TillReceiptLine": {
        "additionalProperties": false,
        "properties": {
          "line": {
            "description": "Il numero della riga, da 1.",
            "title": "Line",
            "type": "integer"
          },
          "article_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'articolo del catalogo (vuoto per le righe vendute prima degli identificativi).",
            "title": "Article Id"
          },
          "department_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Department Id"
          },
          "department": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero del reparto sul registratore.",
            "title": "Department"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "quantity": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Quantity",
            "type": "string"
          },
          "unit_price_cents": {
            "description": "Il prezzo unitario, IVA compresa.",
            "title": "Unit Price Cents",
            "type": "integer"
          },
          "discount_cents": {
            "description": "Lo sconto della riga.",
            "title": "Discount Cents",
            "type": "integer"
          },
          "vat_rate": {
            "anyOf": [
              {
                "description": "Numero decimale come testo, senza arrotondamenti.",
                "pattern": "^-?\\d+(\\.\\d+)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "L'aliquota IVA della riga, in percento, com'era sullo scontrino.",
            "title": "Vat Rate"
          },
          "total_cents": {
            "description": "Quantità per prezzo meno lo sconto della riga.",
            "title": "Total Cents",
            "type": "integer"
          }
        },
        "required": [
          "line",
          "article_id",
          "department_id",
          "department",
          "description",
          "quantity",
          "unit_price_cents",
          "discount_cents",
          "vat_rate",
          "total_cents"
        ],
        "title": "TillReceiptLine",
        "type": "object"
      },
      "TillReceiptQuery": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Quanti per pagina, da 1 a 100 (50 se manca).",
            "title": "Limit"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_\\-]{1,300}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il `next` della pagina prima: da qui riparte l'elenco.",
            "title": "After"
          },
          "from": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Dal giorno (compreso), nell'ora del locale.",
            "title": "From"
          },
          "to": {
            "anyOf": [
              {
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Fino al giorno (compreso), nell'ora del locale.",
            "title": "To"
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "sale",
                  "void",
                  "refund"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "sale vendita, void annullo, refund reso.",
            "title": "Kind"
          },
          "state": {
            "anyOf": [
              {
                "enum": [
                  "printed",
                  "pending",
                  "uncertain",
                  "failed",
                  "not_printed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "title": "State"
          },
          "device": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9_.\\-]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il codice di un iPad: solo i suoi.",
            "title": "Device"
          },
          "z_number": {
            "anyOf": [
              {
                "maximum": 1000000,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Il numero della chiusura fiscale (Z).",
            "title": "Z Number"
          }
        },
        "title": "TillReceiptQuery",
        "type": "object"
      },
      "TillReceiptSummary": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "sale vendita, void annullo, refund reso.",
            "enum": [
              "sale",
              "void",
              "refund"
            ],
            "title": "Kind",
            "type": "string"
          },
          "state": {
            "description": "printed stampato dal registratore; pending in attesa della stampa; uncertain la stampante non ha risposto e la cassa non sa se è uscito; failed non stampato; not_printed annullato prima della stampa. Solo printed vale per il fisco.",
            "enum": [
              "printed",
              "pending",
              "uncertain",
              "failed",
              "not_printed"
            ],
            "title": "State",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "day": {
            "description": "Il giorno nell'ora del locale.",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Day",
            "type": "string"
          },
          "device": {
            "description": "Il codice dell'iPad.",
            "title": "Device",
            "type": "string"
          },
          "device_name": {
            "description": "Il nome dell'iPad per le persone.",
            "title": "Device Name",
            "type": "string"
          },
          "road": {
            "description": "La strada della cassa: D è il servizio vero; le altre sono prova e addestramento (non contano negli incassi della Panoramica).",
            "title": "Road",
            "type": "string"
          },
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "La matricola del registratore fiscale.",
            "title": "Serial"
          },
          "z_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero della chiusura fiscale (Z) che lo contiene.",
            "title": "Z Number"
          },
          "receipt_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero dello scontrino nella giornata fiscale.",
            "title": "Receipt Number"
          },
          "order_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il numero d'ordine chiamato al banco.",
            "title": "Order Number"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chi era alla cassa.",
            "title": "Operator"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il responsabile che ha approvato (annulli e resi).",
            "title": "Approved By"
          },
          "total_cents": {
            "description": "Il totale, IVA compresa, sempre positivo: il tipo dice il verso.",
            "title": "Total Cents",
            "type": "integer"
          },
          "discount_cents": {
            "description": "Lo sconto sul totale del conto (quelli di riga sono sulle righe).",
            "title": "Discount Cents",
            "type": "integer"
          },
          "change_cents": {
            "description": "Il resto dato in contanti.",
            "title": "Change Cents",
            "type": "integer"
          },
          "reverses": {
            "anyOf": [
              {
                "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
                "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per annulli e resi: la vendita che correggono.",
            "title": "Reverses"
          },
          "payments": {
            "items": {
              "$ref": "#/components/schemas/Payment"
            },
            "title": "Payments",
            "type": "array"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "created_at",
          "day",
          "device",
          "device_name",
          "road",
          "serial",
          "z_number",
          "receipt_number",
          "order_number",
          "operator",
          "approved_by",
          "total_cents",
          "discount_cents",
          "change_cents",
          "reverses",
          "payments"
        ],
        "title": "TillReceiptSummary",
        "type": "object"
      },
      "TillReceiptSummaryPage": {
        "additionalProperties": false,
        "description": "Una pagina di scontrini.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/TillReceiptSummary"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "TillReceiptSummaryPage",
        "type": "object"
      },
      "TillSite": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "La sede, la stessa di `/v1/sites`.",
            "title": "Id",
            "type": "integer"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vuoto se la sede è chiusa.",
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vuoto se la sede è chiusa.",
            "title": "Name"
          }
        },
        "required": [
          "id",
          "code",
          "name"
        ],
        "title": "TillSite",
        "type": "object"
      },
      "Totals": {
        "additionalProperties": false,
        "properties": {
          "sales_cents": {
            "description": "In centesimi di euro.",
            "title": "Sales Cents",
            "type": "integer"
          },
          "voids_cents": {
            "description": "In centesimi di euro.",
            "title": "Voids Cents",
            "type": "integer"
          },
          "refunds_cents": {
            "description": "In centesimi di euro.",
            "title": "Refunds Cents",
            "type": "integer"
          }
        },
        "required": [
          "sales_cents",
          "voids_cents",
          "refunds_cents"
        ],
        "title": "Totals",
        "type": "object"
      },
      "Transmission": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "environment": {
            "enum": [
              "sandbox",
              "production"
            ],
            "title": "Environment",
            "type": "string"
          },
          "file_name": {
            "title": "File Name",
            "type": "string"
          },
          "state": {
            "enum": [
              "queued",
              "submitted",
              "failed",
              "sent",
              "delivered",
              "not_delivered",
              "rejected",
              "accepted",
              "refused",
              "expired"
            ],
            "title": "State",
            "type": "string"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "attempts": {
            "title": "Attempts",
            "type": "integer"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "submitted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted At"
          },
          "state_at": {
            "title": "State At",
            "type": "string"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/TransmissionEvent"
            },
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "id",
          "provider",
          "environment",
          "file_name",
          "state",
          "last_error",
          "attempts",
          "created_at",
          "submitted_at",
          "state_at",
          "events"
        ],
        "title": "Transmission",
        "type": "object"
      },
      "TransmissionEvent": {
        "additionalProperties": false,
        "properties": {
          "state": {
            "description": "Lo stato che il canale ha comunicato.",
            "title": "State",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "errors": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Gli errori dello SDI, uno per voce, col loro codice.",
            "title": "Errors"
          },
          "happened_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Happened At"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          }
        },
        "required": [
          "state",
          "description",
          "errors",
          "happened_at",
          "received_at"
        ],
        "title": "TransmissionEvent",
        "type": "object"
      },
      "TwoReceipts": {
        "additionalProperties": false,
        "properties": {
          "card": {
            "title": "Card",
            "type": "integer"
          },
          "code_end": {
            "title": "Code End",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "first_at": {
            "format": "date-time",
            "title": "First At",
            "type": "string"
          },
          "second_at": {
            "format": "date-time",
            "title": "Second At",
            "type": "string"
          },
          "receipts": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "title": "Receipts",
            "type": "array"
          },
          "cents": {
            "items": {
              "type": "integer"
            },
            "title": "Cents",
            "type": "array"
          }
        },
        "required": [
          "card",
          "code_end",
          "channel",
          "first_at",
          "second_at",
          "receipts",
          "cents"
        ],
        "title": "TwoReceipts",
        "type": "object"
      },
      "Unsure": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "L'identificativo: il codice dell'iPad che l'ha fatto, un punto, il numero del documento su quell'iPad.",
            "pattern": "^[A-Za-z0-9_.\\-]{1,60}\\.[A-Z0-9]{4,16}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "total_cents": {
            "description": "In centesimi di euro.",
            "title": "Total Cents",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "total_cents",
          "created_at"
        ],
        "title": "Unsure",
        "type": "object"
      },
      "Variant": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vuoto per l'unica variante di un articolo senza varianti.",
            "title": "Name"
          },
          "prices": {
            "description": "Un prezzo per ogni listino aperto oggi.",
            "items": {
              "$ref": "#/components/schemas/VariantPrice"
            },
            "title": "Prices",
            "type": "array"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "prices"
        ],
        "title": "Variant",
        "type": "object"
      },
      "VariantIn": {
        "properties": {
          "name": {
            "description": "Il nome della variante, per esempio «Grande»; maiuscole e minuscole non contano.",
            "maxLength": 60,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "VariantIn",
        "type": "object"
      },
      "VariantPrice": {
        "additionalProperties": false,
        "properties": {
          "list_id": {
            "description": "Il listino.",
            "format": "uuid",
            "title": "List Id",
            "type": "string"
          },
          "cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Il prezzo al banco che la cassa fa con quel listino, IVA compresa (se il listino non lo dice, quello del listino di tutti i giorni).",
            "title": "Cents"
          }
        },
        "required": [
          "list_id",
          "cents"
        ],
        "title": "VariantPrice",
        "type": "object"
      },
      "VatRate": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rate": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Rate",
            "type": "string"
          },
          "nature": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nature"
          },
          "valid_from": {
            "title": "Valid From",
            "type": "string"
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid To"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "rate",
          "nature",
          "valid_from",
          "valid_to"
        ],
        "title": "VatRate",
        "type": "object"
      },
      "VatRatePage": {
        "additionalProperties": false,
        "description": "Una pagina di aliquote.",
        "properties": {
          "data": {
            "description": "Gli elementi di questa pagina.",
            "items": {
              "$ref": "#/components/schemas/VatRate"
            },
            "title": "Data",
            "type": "array"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Da passare come `after` per la pagina dopo; vuoto quando l'elenco è finito.",
            "title": "Next"
          }
        },
        "required": [
          "data",
          "next"
        ],
        "title": "VatRatePage",
        "type": "object"
      },
      "VatTotal": {
        "additionalProperties": false,
        "properties": {
          "rate": {
            "description": "Numero decimale come testo, senza arrotondamenti.",
            "pattern": "^-?\\d+(\\.\\d+)?$",
            "title": "Rate",
            "type": "string"
          },
          "gross_cents": {
            "description": "In centesimi di euro.",
            "title": "Gross Cents",
            "type": "integer"
          },
          "taxable_cents": {
            "description": "In centesimi di euro.",
            "title": "Taxable Cents",
            "type": "integer"
          },
          "tax_cents": {
            "description": "Scorporata una volta sul totale dell'aliquota, come fa il registratore.",
            "title": "Tax Cents",
            "type": "integer"
          }
        },
        "required": [
          "rate",
          "gross_cents",
          "taxable_cents",
          "tax_cents"
        ],
        "title": "VatTotal",
        "type": "object"
      },
      "Window": {
        "additionalProperties": false,
        "properties": {
          "cents": {
            "description": "Incassato, annulli e resi tolti.",
            "title": "Cents",
            "type": "integer"
          },
          "receipts": {
            "description": "Scontrini, annulli e resi tolti.",
            "title": "Receipts",
            "type": "integer"
          },
          "average_cents": {
            "anyOf": [
              {
                "description": "In centesimi di euro.",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Scontrino medio.",
            "title": "Average Cents"
          }
        },
        "required": [
          "cents",
          "receipts",
          "average_cents"
        ],
        "title": "Window",
        "type": "object"
      },
      "Written": {
        "additionalProperties": false,
        "properties": {
          "table": {
            "$ref": "#/components/schemas/Table"
          },
          "warnings": {
            "description": "Quello che l'iPad avrebbe stampato e non è uscito (comanda, storno, avvisi): la scrittura resta fatta, qualcuno avvisa a voce.",
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "table",
          "warnings"
        ],
        "title": "Written",
        "type": "object"
      }
    },
    "securitySchemes": {
      "key": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "cmp_live_<id>_<segreto>",
        "description": "Una chiave API della suite, creata dal titolare nella pagina «Chiavi API» del backoffice."
      }
    }
  }
}
