{
  "openapi": "3.1.0",
  "info": {
    "title": "Kabala client API",
    "version": "1.0.0",
    "description": "The API of connected systems. JSON over HTTPS under /v1.\n\nAuthentication. Every request carries `Authorization: Bearer <API key>`. A key is shown once when it is issued; keep it like a password. Every failure of authentication is the same 401 with no reason.\n\nGetting a key. The owner of a business makes keys in the portal of the product, under \"מפתחות גישה\": a key acts for that business only, has a name, the scopes it needs, and may be held to a list of networks and to an end. A sandbox deployment may also offer a sign-up that gives a sandbox business and a key at once. A platform that serves many businesses is given its keys by the operator and asks each business for its permission.\n\nScopes. Every route needs one scope, stated in its `security` requirement; a key without it answers 403 KEY_SCOPE_MISSING (details.requiredScope). `read`: Read: every GET route but those of the finances (businesses, drafts, documents and their copies, customers, delivery records, uniform files and reports, transmission and allocation state, backups, reference data) and the lookups of a received invoice. `issue`: Issue: prepare and confirm a document, cancel one, and the allocation numbers of the Tax Authority (ask, record, decide). `delivery`: Delivery: make, revoke and email a personal link, and report or withdraw the consent of a customer. `records`: Records: produce a uniform-structure file, transmit it and ask for its status, and start a backup. `businesses`: Businesses: add a business to the register, and choose the design of the documents of a business this client serves. Never held by a key of the direct connection of a business, whose owner chooses the design in the portal. `webhooks`: Webhooks: manage the subscriptions to events of the client system. `finance`: Finance: read the year of a business (income, expenses and profit by month, by customer and by category), its expenses and the file of the receipt of each. Held only by a key of the direct connection of the business. `expenses`: Expenses: record, correct and remove an expense of the business, and attach the file of its receipt. Held only by a key of the direct connection of the business. `pos`: Register: read the catalog, the registers and the closes of the register of the business, and keep its catalog by item code. Held only by a key of the direct connection of the business. A key held to networks answers 403 KEY_ADDRESS_NOT_ALLOWED from any other address (details.address). Both errors also carry `messageHe`, the same sentence in Hebrew.\n\nBusinesses and tenancy. A client system acts for a business only while that business gives it a standing grant. A business it may not act for, a grant that was withdrawn, an identifier that does not exist and a path that does not exist all answer the same 404 with the same body: the answer never tells which.\n\nIssuing is two steps. (1) Prepare: `POST /v1/issuers/{issuerId}/drafts` with an `Idempotency-Key` header validates the request, computes every amount and stores a draft that expires; nothing is issued. (2) Confirm: `POST /v1/drafts/{draftId}/confirm` issues the document in one transaction: it takes the next number, and its original is rendered, signed and stored. There is no single-call issue.\n\nIdempotency. Choose one Idempotency-Key per document you mean to issue and keep it until you hold the document. Repeating a prepare with the same key and the same body returns the same draft, or the document it became. Repeating a confirm returns the same document. The service never repeats an issue by itself. A production of the uniform file, and a new expense, take a key in the same way.\n\nWhen the outcome is unknown. If a confirm answers 504 with code OUTCOME_UNKNOWN, or no answer arrives at all (a cut connection, a timeout, a 5xx that is not this API's error body), the document may or may not have been issued. Send the same confirm again; it will return the document or issue it once. Never prepare again under a new key in that state.\n\nAmounts are decimal text with exactly two decimals (\"118.00\"); quantities are decimal text with exactly four (\"1.0000\"); dates are \"YYYY-MM-DD\"; document numbers and codes are JSON integers. An amount sent as a JSON number is refused, never rounded. The server computes every total and the VAT; a caller may send `expectedTotal` and is refused when it differs.\n\nA final document is never changed or deleted. While its original has not left the business it can be cancelled (`POST /v1/documents/{documentId}/cancellation`). After that it is corrected by a further document, prepared and confirmed like any other: a tax invoice (305, 320) by a credit note (330) that names it in `creditedInvoices`; a receipt (400) by a cancelling receipt, a 400 whose `corrects` names it, which takes back the whole receipt once and is issued with every amount below zero; the money received on a tax invoice / receipt (320) by a cancelling receipt too, a 400 whose `corrects` names the 320, which takes back its whole payment once (the credit note reduces the sale and its VAT, the cancelling receipt returns the payment: two documents, each on its own); a part of the money of a receipt or of a 320 by a partial cancelling receipt, a 400 whose `corrects` names it with effect `cancel-part` and whose own payment lines say how the money went back, as many times as money is left (after a part, the rest is taken back by a further part, never in full); a transaction invoice (300) by a correcting transaction invoice, a 300 whose `corrects` names it, with the effect (credit or charge) and the reason. Amounts below zero (\"-118.00\") appear only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits; add the totals of documents as they are and the sum is right.\n\nDelivery. The product delivers a document to the customer itself; a client system asks for it. `POST /v1/documents/{documentId}/links` makes a personal link to a page of the issuing business, where the customer consents to computerized documents (once per business) and downloads. The first download is the original and it leaves once; every later one is a copy. A client system is never handed the original: `GET /v1/documents/{documentId}/pdf` returns a copy. Send the link through your own channel, or let the product email it where the deployment sends email (otherwise: MAILER_NOT_CONFIGURED). A document can be cancelled only while its original has not left, and only with the statement of the business that it was not yet reported.\n\nThe uniform file and its transmission. `POST /v1/issuers/{issuerId}/uniform-exports` produces and stores the files of a date range, under an Idempotency-Key of its own. `POST .../uniform-exports/{exportId}/transmission` sends a stored production to the Tax Authority and is also how a transmission is continued or sent again. The owner of the business signs in at the Tax Authority in the portal of the product; a client system never holds a token of the Authority and is never asked for one.\n\nErrors. Every error has the body `{ \"error\": { \"code\", \"message\", \"details\", \"issues\"?, \"requestId\" } }`. Match on `code`. `requestId` is also the `X-Request-Id` header of every answer; quote it when asking about a request.\n\nWebhooks. Register an address of your system (`POST /v1/webhook-endpoints`) and the service posts a signed notice to it when something happens: a document issued, a draft confirmed or expired, a link opened, a file downloaded, a consent changed, an allocation number received, a transmission answered, a business activated or a grant given or withdrawn. A notice is thin: the kind, when, the business and identifiers, never a document or a name; read the details with your key. Every notice carries `Tring-Signature: t=<unix seconds>,v1=<hex>`, HMAC-SHA256 of `<t>.<raw body>` under the secret of the address: check it, and refuse a `t` more than five minutes from your clock. A notice that is not answered 2xx within 10 seconds is tried again for three days; an address that takes nothing for three days is switched off and the business is told. Delivery is at least once and in no promised order: do nothing twice for one event id. Reading still works: `GET /v1/events?after=<last event id>` holds every event meant for your system. The kinds and their bodies are the `webhooks` section of this file.\n\nFinances. The business's own connection reads the year of income, expenses and profit (`GET /v1/issuers/{issuerId}/finance?year=`, scope `finance`) and keeps its expenses (`/v1/issuers/{issuerId}/expenses`, scope `expenses` to write). Income is read from the documents the business issued, by the same rules as the portal's screen \"כספים\", and nothing of them changes. Expenses are the owner's management aid, outside the records of the accounts system: no expense enters a document, a series, the uniform file or any transmission. An expense may be corrected (PATCH) and removed (DELETE); a removed expense is kept, shown nowhere and counted in no total. A key of a platform that serves many businesses never holds these scopes.\n\nRate limits. Requests are limited per key and per address; a 429 carries `Retry-After` in seconds.\n\nNo answer may be cached: every response carries `Cache-Control: no-store`."
  },
  "servers": [
    {
      "url": "/",
      "description": "The address of the deployment. Sandbox and production are separate deployments with separate keys."
    }
  ],
  "tags": [
    {
      "name": "Businesses"
    },
    {
      "name": "Issuing"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Delivery"
    },
    {
      "name": "Customers"
    },
    {
      "name": "Uniform file"
    },
    {
      "name": "Transmission"
    },
    {
      "name": "Allocation"
    },
    {
      "name": "Backup"
    },
    {
      "name": "Finances"
    },
    {
      "name": "Register"
    },
    {
      "name": "Reference"
    },
    {
      "name": "Webhooks"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v1/issuers": {
      "post": {
        "operationId": "createIssuer",
        "tags": [
          "Businesses"
        ],
        "summary": "Add a business",
        "description": "Adds a business with its details. It joins as \"invited\" and can issue nothing. Its owner then activates it in the product's own portal and gives this client permission to act for it; until then every issuing call for it answers 404. Sending the same request again returns the same business (\"replayed\": true); the same registration number with other details, or a business this client already acts for, answers ISSUER_ALREADY_EXISTS. One registration number is one business, whoever adds it: when the register already holds the number for a business this client may not act for, nothing is added, the answer is ISSUER_REGISTERED, and the owner of that business is asked in the portal to give this client permission. Text is cleaned of invisible characters and repeated spaces before it is stored.",
        "parameters": [],
        "security": [
          {
            "apiKey": [
              "businesses"
            ]
          }
        ],
        "x-required-scope": "businesses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIssuerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The business had already been added by this client with the same details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when this client had already added this very business and nothing new was stored."
                    },
                    "issuer": {
                      "$ref": "#/components/schemas/Issuer"
                    }
                  },
                  "required": [
                    "replayed",
                    "issuer"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The business was added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when this client had already added this very business and nothing new was stored."
                    },
                    "issuer": {
                      "$ref": "#/components/schemas/Issuer"
                    }
                  },
                  "required": [
                    "replayed",
                    "issuer"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_ALREADY_EXISTS: This client already created a business with this registration number, or already acts for it; details.issuerId names it.\n\nISSUER_REGISTERED: Another business of the register holds this registration number, and this client may not act for it; nothing was added. Its owner is asked in the portal to give this client permission (details.grantRequest \"pending\"; \"declined\" within 30 days of a refusal). Once given, GET /v1/issuers lists the business.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listIssuers",
        "tags": [
          "Businesses"
        ],
        "summary": "The businesses of this client",
        "description": "Every business that gives this client a standing grant, and every business this client added that is still \"invited\".",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of businesses.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of businesses.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Issuer"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "Pass as \"cursor\" to read the next page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}": {
      "get": {
        "operationId": "getIssuer",
        "tags": [
          "Businesses"
        ],
        "summary": "One business",
        "description": "The business with the version of its details in force today. \"status\" and \"granted\" say whether documents can be issued for it.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The business.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issuer"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/design": {
      "get": {
        "operationId": "getDocumentDesign",
        "tags": [
          "Businesses"
        ],
        "summary": "The design of the business's documents",
        "description": "The template, accent colour, typeface and line of the business that its next document is printed with. The elements the law asks a document to show are printed by the service in every template and are not part of a design.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The design in force.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The design of the documents a business produces from now on.",
                  "properties": {
                    "version": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1,
                      "description": "The version of the design, from 1; null when the business never chose one and its documents are printed in the page they always had (the values below are then that page)."
                    },
                    "template": {
                      "type": "string",
                      "maxLength": 10,
                      "enum": [
                        "classic",
                        "modern",
                        "minimal",
                        "warm"
                      ],
                      "description": "The page template: \"classic\" (a clean ledger, the page of every document before a design was chosen), \"modern\" (a band of the accent at the head), \"minimal\" (white space and hairlines), \"warm\" (round corners and soft tints)."
                    },
                    "accent": {
                      "type": "string",
                      "maxLength": 7,
                      "pattern": "^#[0-9a-f]{6}$",
                      "description": "The accent colour, #rrggbb in lower case."
                    },
                    "font": {
                      "type": "string",
                      "maxLength": 20,
                      "enum": [
                        "assistant",
                        "heebo",
                        "rubik",
                        "open-sans",
                        "noto-sans-hebrew"
                      ],
                      "description": "The typeface of the page, one the service carries: \"assistant\", \"heebo\", \"rubik\", \"open-sans\", \"noto-sans-hebrew\"."
                    },
                    "footerText": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "The business's own line at the end of the page."
                    },
                    "recordedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 40,
                      "format": "date-time",
                      "description": "When this version was stored, ISO 8601 in UTC; null with no version."
                    }
                  },
                  "required": [
                    "version",
                    "template",
                    "accent",
                    "font",
                    "footerText",
                    "recordedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "putDocumentDesign",
        "tags": [
          "Businesses"
        ],
        "summary": "Choose the design of the business's documents",
        "description": "Stores the design as a new version. It applies to the documents produced after it; a document already issued keeps the design it was produced with, in every copy. Sending the design in force stores nothing and answers it with \"created\": false. A design that cannot be stored answers DESIGN_REFUSED, and details name the field and the reason (\"unknown\", \"format\", \"contrast\" with a \"suggestion\", \"too-long\", \"reserved-word\" with the \"word\", \"mixed-word\" for a Latin letter, digit or symbol between two Hebrew letters, \"character\", \"long-number\").",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "businesses"
            ]
          }
        ],
        "x-required-scope": "businesses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A whole design. Every field is stated; a left-out footerText is none.",
                "properties": {
                  "template": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "classic",
                      "modern",
                      "minimal",
                      "warm"
                    ],
                    "description": "The page template: \"classic\" (a clean ledger, the page of every document before a design was chosen), \"modern\" (a band of the accent at the head), \"minimal\" (white space and hairlines), \"warm\" (round corners and soft tints)."
                  },
                  "accent": {
                    "type": "string",
                    "maxLength": 7,
                    "pattern": "^#?[0-9a-fA-F]{6}$",
                    "description": "The accent colour as #rrggbb. It must reach a contrast of 4.5:1 against white and against its own light tint (WCAG 2.2, 1.4.3); a lighter one answers DESIGN_REFUSED with a darker shade of the same hue in details.suggestion."
                  },
                  "font": {
                    "type": "string",
                    "maxLength": 20,
                    "enum": [
                      "assistant",
                      "heebo",
                      "rubik",
                      "open-sans",
                      "noto-sans-hebrew"
                    ],
                    "description": "The typeface of the page, one the service carries: \"assistant\", \"heebo\", \"rubik\", \"open-sans\", \"noto-sans-hebrew\"."
                  },
                  "footerText": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 1000,
                    "description": "The business's own line, printed small at the end of the page; null for none. At most 200 characters after white space is folded. It may not hold a word a document must say by law (a role word, \"ממוחשב\", a document type, a dealer type, the words of VAT or of an allocation) or nine digits in a row."
                  }
                },
                "required": [
                  "template",
                  "accent",
                  "font"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The design in force after the call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "boolean",
                      "description": "True when a new version was stored."
                    },
                    "design": {
                      "type": "object",
                      "description": "The design of the documents a business produces from now on.",
                      "properties": {
                        "version": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1,
                          "description": "The version of the design, from 1; null when the business never chose one and its documents are printed in the page they always had (the values below are then that page)."
                        },
                        "template": {
                          "type": "string",
                          "maxLength": 10,
                          "enum": [
                            "classic",
                            "modern",
                            "minimal",
                            "warm"
                          ],
                          "description": "The page template: \"classic\" (a clean ledger, the page of every document before a design was chosen), \"modern\" (a band of the accent at the head), \"minimal\" (white space and hairlines), \"warm\" (round corners and soft tints)."
                        },
                        "accent": {
                          "type": "string",
                          "maxLength": 7,
                          "pattern": "^#[0-9a-f]{6}$",
                          "description": "The accent colour, #rrggbb in lower case."
                        },
                        "font": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "assistant",
                            "heebo",
                            "rubik",
                            "open-sans",
                            "noto-sans-hebrew"
                          ],
                          "description": "The typeface of the page, one the service carries: \"assistant\", \"heebo\", \"rubik\", \"open-sans\", \"noto-sans-hebrew\"."
                        },
                        "footerText": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 200,
                          "description": "The business's own line at the end of the page."
                        },
                        "recordedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 40,
                          "format": "date-time",
                          "description": "When this version was stored, ISO 8601 in UTC; null with no version."
                        }
                      },
                      "required": [
                        "version",
                        "template",
                        "accent",
                        "font",
                        "footerText",
                        "recordedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "created",
                    "design"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "DESIGN_REFUSED: The design was not stored; details.field and details.reason say why, details.suggestion offers a readable colour, details.word names a word the line may not hold.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/drafts": {
      "post": {
        "operationId": "prepareDraft",
        "tags": [
          "Issuing"
        ],
        "summary": "Prepare a document",
        "description": "Step one of two. The server validates the request, computes every amount and stores a pending draft that expires. Nothing is issued and no number is taken. The answer is the computed document and its warnings: show it, or its preview, before confirming.\n\nIdempotency: the Idempotency-Key header is required, 1 to 255 printable ASCII characters, chosen by the caller, one per document it means to issue. The same key with the same request returns the same draft, or the document it became; the same key with a different request, or for another business, is refused (IDEMPOTENCY_KEY_REUSED). A key whose draft expired answers DRAFT_EXPIRED for good: prepare again under a new key.\n\nAmounts are decimal text with exactly two decimals (\"118.00\") and quantities with exactly four (\"1.0000\"). A JSON number in their place is refused, never rounded. A key that is not part of the body is refused (issue code FIELD_UNKNOWN), never ignored.\n\nSend customer.key or customer.externalRef: without one of them every document creates a new customer record.\n\nA document that corrects an earlier one (a cancelling receipt, a correcting transaction invoice) names it in `corrects` and sends no customer: the customer is the one of the corrected document. The issue codes of a document that cannot be corrected are CORRECTED_DOCUMENT_NOT_FOUND, CORRECTED_DOCUMENT_CANCELLED, CORRECTED_DOCUMENT_NOT_RELEASED (cancel it instead), CORRECTED_DOCUMENT_IS_A_CORRECTION and RECEIPT_ALREADY_CANCELLED.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business the document is issued for.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chosen by the caller: one key per document it means to issue.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrepareRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key was used before with this same request: the same draft, or the document it became.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "With outcome \"draft\" the answer holds \"draft\"; with outcome \"document\" it holds \"document\".",
                  "properties": {
                    "outcome": {
                      "type": "string",
                      "maxLength": 10,
                      "enum": [
                        "draft",
                        "document"
                      ],
                      "description": "draft: a pending draft. document: the key had already been confirmed, and this is the document it became."
                    },
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the Idempotency-Key had been used before with this same request and nothing new was stored."
                    },
                    "draft": {
                      "$ref": "#/components/schemas/Draft"
                    },
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "outcome",
                    "replayed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "A new draft was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "With outcome \"draft\" the answer holds \"draft\"; with outcome \"document\" it holds \"document\".",
                  "properties": {
                    "outcome": {
                      "type": "string",
                      "maxLength": 10,
                      "enum": [
                        "draft",
                        "document"
                      ],
                      "description": "draft: a pending draft. document: the key had already been confirmed, and this is the document it became."
                    },
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the Idempotency-Key had been used before with this same request and nothing new was stored."
                    },
                    "draft": {
                      "$ref": "#/components/schemas/Draft"
                    },
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "outcome",
                    "replayed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: The Idempotency-Key was already used with a different request.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DRAFT_ABANDONED: The draft was abandoned. Prepare again under a new Idempotency-Key.\n\nDRAFT_EXPIRED: The draft expired. Prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "DOCUMENT_REFUSED: The document was refused; issues lists every reason. Nothing was stored.\n\nIDEMPOTENCY_KEY_INVALID: The Idempotency-Key header is missing or is not 1 to 255 printable ASCII characters.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "REGISTRATION_NOT_IN_FORCE: No registration certificate is in force for the running edition. Nothing was issued.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/drafts/{draftId}": {
      "get": {
        "operationId": "getDraft",
        "tags": [
          "Issuing"
        ],
        "summary": "Read a draft",
        "description": "A draft this client prepared, in whatever state it is. A draft that became a document names it in \"documentId\".",
        "parameters": [
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "description": "The draft.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The draft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Draft"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DRAFT_CORRUPT: The stored draft is not what the prepare stored. Nothing was issued.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/drafts/{draftId}/preview": {
      "get": {
        "operationId": "previewDraft",
        "tags": [
          "Issuing"
        ],
        "summary": "The preview of a draft, as a PDF",
        "description": "The page the document would be, marked \"טיוטה\", with no number [DOC-05]. It is not a document, is not signed and is never stored. Only a pending draft has a preview.",
        "parameters": [
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "description": "The draft.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The preview.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DRAFT_CONFIRMED: The draft already became a document; details.documentId names it.\n\nDRAFT_STALE: What the draft was computed from has changed since it was prepared. Nothing was issued; prepare again under a new Idempotency-Key.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DRAFT_ABANDONED: The draft was abandoned. Prepare again under a new Idempotency-Key.\n\nDRAFT_EXPIRED: The draft expired. Prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DRAFT_CORRUPT: The stored draft is not what the prepare stored. Nothing was issued.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nRENDER_FAILED: The document file could not be produced. Nothing was issued, stored or handed out. details.reason says why, in one fixed word: \"render-timeout\" and \"browser-unavailable\" can pass by themselves, and the same request may then be sent again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/drafts/{draftId}/confirm": {
      "post": {
        "operationId": "confirmDraft",
        "tags": [
          "Issuing"
        ],
        "summary": "Confirm a draft: issue the document",
        "description": "Step two of two, and the only call that issues. In one transaction the draft becomes a document: it takes the next number of its series, its original is rendered, signed with the key of the business and stored. The request has no body.\n\nRepeating is safe and is how a lost answer is recovered: a confirm of a draft that already became a document returns that same document with \"replayed\": true and issues nothing.\n\nAfter every error nothing was issued, with one exception that says so itself: OUTCOME_UNKNOWN (504) means the service does not know whether the document was issued. The same holds when no answer arrives at all: a cut connection, a timeout, or a 5xx without this API's error body. In all of these, send the same confirm again; never prepare again under a new Idempotency-Key, which could issue a second document.",
        "parameters": [
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "description": "The draft to confirm.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "responses": {
          "200": {
            "description": "The draft had already become this document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the draft had already become this document: nothing was issued by this call."
                    },
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "replayed",
                    "document"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The document was issued by this call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the draft had already become this document: nothing was issued by this call."
                    },
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "replayed",
                    "document"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DRAFT_STALE: What the draft was computed from has changed since it was prepared. Nothing was issued; prepare again under a new Idempotency-Key.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DRAFT_ABANDONED: The draft was abandoned. Prepare again under a new Idempotency-Key.\n\nDRAFT_EXPIRED: The draft expired. Prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "DOCUMENT_REFUSED: The document was refused; issues lists every reason. Nothing was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "COUNTER_MISSING: The business has no number series for this document type. Nothing was issued.\n\nDATABASE_REFUSED: The database refused the request. Nothing was issued, stored or handed out.\n\nDRAFT_CORRUPT: The stored draft is not what the prepare stored. Nothing was issued.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nRENDER_FAILED: The document file could not be produced. Nothing was issued, stored or handed out. details.reason says why, in one fixed word: \"render-timeout\" and \"browser-unavailable\" can pass by themselves, and the same request may then be sent again.\n\nSIGNATURE_NOT_VERIFIED: The signature of the document file did not verify. Nothing was issued, stored or handed out.\n\nSIGNING_FAILED: The document file could not be signed. Nothing was issued, stored or handed out.\n\nSIGNING_KEY_UNAVAILABLE: The business has no usable signing key. Nothing was issued, stored or handed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ISSUE_TIMEOUT: The time limit of issuing passed. Nothing was issued; the same confirm can be sent again.\n\nREGISTRATION_NOT_IN_FORCE: No registration certificate is in force for the running edition. Nothing was issued.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "OUTCOME_UNKNOWN: It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/documents": {
      "get": {
        "operationId": "listDocuments",
        "tags": [
          "Documents"
        ],
        "summary": "The documents of a business",
        "description": "Issued documents, newest first by record number. Every filter is optional; they narrow together. Each call is written to the audit log of the business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Document date, first day of the range. \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Document date, last day of the range. \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          },
          {
            "name": "docType",
            "in": "query",
            "required": false,
            "description": "One document type: 300, 305, 320, 330 or 400.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "enum": [
                "300",
                "305",
                "320",
                "330",
                "400"
              ]
            }
          },
          {
            "name": "customerKey",
            "in": "query",
            "required": false,
            "description": "The stable key of one customer.",
            "schema": {
              "type": "string",
              "maxLength": 15,
              "pattern": "^[A-Za-z0-9_.-]{1,15}$"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "The number of the document in its series; combine with docType.",
            "schema": {
              "type": "string",
              "maxLength": 15,
              "pattern": "^[1-9][0-9]{0,14}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of documents.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of documents.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocumentSummary"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "Pass as \"cursor\" to read the next page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}": {
      "get": {
        "operationId": "getDocument",
        "tags": [
          "Documents"
        ],
        "summary": "One document",
        "description": "The document as the permanent file holds it. Each read is written to the audit log of the business.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/links": {
      "post": {
        "operationId": "createDocumentLink",
        "tags": [
          "Delivery"
        ],
        "summary": "Make a personal link for the recipient of a document",
        "description": "Makes a link through which the customer of the document opens a page of the issuing business and downloads the document. Opening the page hands out nothing; the recipient presses a button. The first download is the \"מקור\" and every later one a \"העתק\". A recipient who has not yet consented to computerized documents of this business is asked on the page, before any download.\n\nThe answer carries the token and the address once; neither can be read back. Send the address to the recipient through your own channel, or pass sendEmailTo and the product sends it in the name of the business (the message carries the link, never the file). With sendEmailTo on a deployment that sends no email the answer is MAILER_NOT_CONFIGURED and no link is made. When a link was made and its email was not sent, the answer is still 201: \"email\" says what became of the message.\n\nNot idempotent: every call makes a new link. A link that is not wanted is revoked. Refused for a cancelled document and for a recipient who withdrew consent.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "delivery"
            ]
          }
        ],
        "x-required-scope": "delivery",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLinkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link was made.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "$ref": "#/components/schemas/Link"
                    },
                    "token": {
                      "type": "string",
                      "maxLength": 43,
                      "description": "The token of the link. Returned this once and stored nowhere: it cannot be read back. Keep it only as long as you need it, and never log it."
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 400,
                      "description": "The address the recipient opens: the page of the issuing business for this document."
                    },
                    "email": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "What became of the email of a link.",
                      "properties": {
                        "sent": {
                          "type": "boolean",
                          "description": "True when the mail service took the message."
                        },
                        "to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 254,
                          "description": "The address the message was sent to."
                        },
                        "messageId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 200,
                          "description": "The identifier the mail service gave the message."
                        },
                        "code": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 60,
                          "description": "When sent is false: the code of the reason (MAIL_FAILED, MAIL_OUTCOME_UNKNOWN, CONSENT_WITHDRAWN, ...)."
                        }
                      },
                      "required": [
                        "sent",
                        "to",
                        "messageId",
                        "code"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "link",
                    "token",
                    "url",
                    "email"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_NUMBER_REQUIRED: The buyer demanded an allocation number, the invoice needs one, and neither a number nor a decision in its place (continue, reverse charge, cancel) is recorded. Its original does not leave the business until then, so no link is made. Ask for the number (it is asked at the issue where the business is connected) or record one; a copy may be fetched meanwhile.\n\nCONSENT_WITHDRAWN: The recipient withdrew the consent to computerized documents of this business. Nothing is sent to them until a new consent is recorded.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nPAYMENT_MEANS_NOT_ALLOWED: The payment-means condition of a secured signature is applied for this business, and the document does not show its payment by the customer's card, a crossed cheque marked \"לא סחיר\" (crossedNotNegotiable) or a bank transfer: details.methods names the other codes of field 1306, details.expectedMeansMissing an invoice that stated none. Nothing is sent by computer; the original goes on paper.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DOCUMENT_CANCELLED: The document is cancelled. Nothing of it is sent to anyone; the business can fetch its \"מבוטל\" view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "MAILER_NOT_CONFIGURED: This deployment sends no email. Nothing was sent; take the link and send it through your own channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listDocumentLinks",
        "tags": [
          "Delivery"
        ],
        "summary": "The links of a document",
        "description": "Every link that was made for the document, oldest first, with its state. Never a token. Each call is written to the audit log of the business.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Link"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/links/{linkId}/revocation": {
      "post": {
        "operationId": "revokeLink",
        "tags": [
          "Delivery"
        ],
        "summary": "Revoke a link",
        "description": "From this moment the link answers its holder like a link that never existed. Repeating is safe: a link that was already revoked stays as it is and \"alreadyRevoked\" is true. The request has no body.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "description": "The link.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "delivery"
            ]
          }
        ],
        "x-required-scope": "delivery",
        "responses": {
          "200": {
            "description": "The link is revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "$ref": "#/components/schemas/Link"
                    },
                    "alreadyRevoked": {
                      "type": "boolean",
                      "description": "True when the link had been revoked before this call."
                    }
                  },
                  "required": [
                    "link",
                    "alreadyRevoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/links/{linkId}/email": {
      "post": {
        "operationId": "sendLinkEmail",
        "tags": [
          "Delivery"
        ],
        "summary": "Ask the product to email a link",
        "description": "Sends an existing link by email, in the name of the business. The token is stored nowhere, so the caller hands back the token it received when the link was made. The address is \"to\", or the address the link was made for. The message carries the link and never the file [STO-01].\n\nA deployment that sends no email answers MAILER_NOT_CONFIGURED: take the address of the link and send it through your own channel. MAIL_OUTCOME_UNKNOWN means exactly that: the message may or may not have left. To send a link again later, make a new link.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "description": "The link.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "delivery"
            ]
          }
        ],
        "x-required-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "maxLength": 43,
                    "description": "The token of this link, as it was returned when the link was made."
                  },
                  "to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 254,
                    "description": "The address to send to. Default: the address the link was made for."
                  }
                },
                "required": [
                  "token"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The mail service took the message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailOutcome"
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CONSENT_WITHDRAWN: The recipient withdrew the consent to computerized documents of this business. Nothing is sent to them until a new consent is recorded.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nLINK_NOT_ACTIVE: The link is revoked or past its time. Make a new link.\n\nPAYMENT_MEANS_NOT_ALLOWED: The payment-means condition of a secured signature is applied for this business, and the document does not show its payment by the customer's card, a crossed cheque marked \"לא סחיר\" (crossedNotNegotiable) or a bank transfer: details.methods names the other codes of field 1306, details.expectedMeansMissing an invoice that stated none. Nothing is sent by computer; the original goes on paper.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DOCUMENT_CANCELLED: The document is cancelled. Nothing of it is sent to anyone; the business can fetch its \"מבוטל\" view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "MAILER_NOT_CONFIGURED: This deployment sends no email. Nothing was sent; take the link and send it through your own channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "MAIL_FAILED: The mail service refused the message. Nothing was sent; the link itself stands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "MAIL_OUTCOME_UNKNOWN: It is not known whether the message was sent: the mail service did not answer in time. The link itself stands. Sending again may deliver a second message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/customers/{customerKey}/consent": {
      "post": {
        "operationId": "reportConsent",
        "tags": [
          "Delivery"
        ],
        "summary": "Report a consent the client system collected",
        "description": "Records that this customer consented to receive computerized documents of this business, when the client system collected the consent itself [SIG-11, SIG-12]. The exact words the customer agreed to and the evidence are required and are kept with the moment and the request. A consent given on the page of a link needs no report: the page records it. Every report is a new record.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "customerKey",
            "in": "path",
            "required": true,
            "description": "The stable key of the customer.",
            "schema": {
              "type": "string",
              "maxLength": 15
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "delivery"
            ]
          }
        ],
        "x-required-scope": "delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportConsentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The consent was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recorded": {
                      "type": "boolean",
                      "description": "False when the state already was what was asked for and no record was added."
                    },
                    "consent": {
                      "$ref": "#/components/schemas/Consent"
                    }
                  },
                  "required": [
                    "recorded",
                    "consent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getConsent",
        "tags": [
          "Delivery"
        ],
        "summary": "The consent of a customer",
        "description": "Whether a consent of this customer toward this business stands, whether the last word was a withdrawal, and every record that led there [SIG-13].",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "customerKey",
            "in": "path",
            "required": true,
            "description": "The stable key of the customer.",
            "schema": {
              "type": "string",
              "maxLength": 15
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentState"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/customers/{customerKey}/consent/withdrawal": {
      "post": {
        "operationId": "withdrawConsent",
        "tags": [
          "Delivery"
        ],
        "summary": "Report that a customer withdrew consent",
        "description": "Records a withdrawal the client system received. From this moment the product sends this customer nothing more of this business: no download through any link, no new link, no email [SIG-14]. Repeating is safe: a withdrawal that is already in force adds no record (\"recorded\": false, 200). The body may be left out.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "customerKey",
            "in": "path",
            "required": true,
            "description": "The stable key of the customer.",
            "schema": {
              "type": "string",
              "maxLength": 15
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "delivery"
            ]
          }
        ],
        "x-required-scope": "delivery",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawConsentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A withdrawal was already in force.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recorded": {
                      "type": "boolean",
                      "description": "False when the state already was what was asked for and no record was added."
                    },
                    "consent": {
                      "$ref": "#/components/schemas/Consent"
                    }
                  },
                  "required": [
                    "recorded",
                    "consent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The withdrawal was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recorded": {
                      "type": "boolean",
                      "description": "False when the state already was what was asked for and no record was added."
                    },
                    "consent": {
                      "$ref": "#/components/schemas/Consent"
                    }
                  },
                  "required": [
                    "recorded",
                    "consent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/pdf": {
      "get": {
        "operationId": "downloadDocument",
        "tags": [
          "Documents"
        ],
        "summary": "The file of a document, as a PDF",
        "description": "A client system is handed a \"העתק\" (copy) of the document, or the \"מבוטל\" view of a cancelled one, signed with the key of the business. It is never handed the \"מקור\": the original leaves once, to the customer, through a link or on paper. \"form\" chooses the computerized form (default) or the paper form, for printing.\n\nEvery call renders, signs and stores a new file and records the hand-over, so the route has a limit of its own per API key: a 429 with Retry-After beyond it. Keep the file instead of fetching it again.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "form",
            "in": "query",
            "required": false,
            "description": "computerized (default) or paper.",
            "schema": {
              "type": "string",
              "maxLength": 12,
              "enum": [
                "computerized",
                "paper"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The signed file.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DATABASE_REFUSED: The database refused the request. Nothing was issued, stored or handed out.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nRENDER_FAILED: The document file could not be produced. Nothing was issued, stored or handed out. details.reason says why, in one fixed word: \"render-timeout\" and \"browser-unavailable\" can pass by themselves, and the same request may then be sent again.\n\nSIGNATURE_NOT_VERIFIED: The signature of the document file did not verify. Nothing was issued, stored or handed out.\n\nSIGNING_FAILED: The document file could not be signed. Nothing was issued, stored or handed out.\n\nSIGNING_KEY_UNAVAILABLE: The business has no usable signing key. Nothing was issued, stored or handed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "DELIVER_TIMEOUT: The time limit passed. Nothing was stored or handed out; the same request can be sent again.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "OUTCOME_UNKNOWN: It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/cancellation": {
      "post": {
        "operationId": "cancelDocument",
        "tags": [
          "Delivery"
        ],
        "summary": "Cancel a document",
        "description": "A document can be cancelled only while its \"מקור\" has not left the business, and only with the statement of the business that it was not yet reported [DOC-54]. The document keeps its number and its record; from then on only its \"מבוטל\" view is rendered, and nothing of it is sent to anyone. Nothing is deleted.\n\nOnce the original left (a first download through a link, or a print for hand-over) the answer is ORIGINAL_RELEASED, and details.correction names the further document that corrects it, and nothing else does: \"credit-note\" for a tax invoice (a 330 that credits it), \"cancelling-receipt\" for a receipt (a 400 whose `corrects` names it [DOC-56]), \"correcting-invoice\" for a transaction invoice (a 300 whose `corrects` names it [DOC-73]). A document that itself corrects another is never cancelled (CORRECTION_NOT_CANCELLABLE). Repeating a cancellation that took effect answers ALREADY_CANCELLED.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The document is cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "documentId": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The document."
                    },
                    "cancelledAt": {
                      "type": "string",
                      "maxLength": 30,
                      "format": "date-time",
                      "description": "When the cancellation was recorded. ISO 8601, UTC."
                    }
                  },
                  "required": [
                    "documentId",
                    "cancelledAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALREADY_CANCELLED: The document is already cancelled.\n\nCORRECTION_NOT_CANCELLABLE: The document corrects another document (a cancelling receipt or a correcting transaction invoice) and is never cancelled. A mistake in it is put right by a further document.\n\nDOCUMENT_REFERENCED: Another standing document relates to this one. It cannot be cancelled.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nORIGINAL_RELEASED: The original of the document already left the business, so the document cannot be cancelled. details.correction names the document that corrects it instead: \"credit-note\" for a tax invoice (issue a 330), \"cancelling-receipt\" for a receipt (issue a 400 with `corrects`), \"correcting-invoice\" for a transaction invoice (issue a 300 with `corrects`); null for a credit note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "DECLARATION_REQUIRED: A cancellation needs the statement of the business that the document was not yet reported: send declaredUnreported as true, and only when the business itself said so.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DATABASE_REFUSED: The database refused the request. Nothing was issued, stored or handed out.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "DELIVER_TIMEOUT: The time limit passed. Nothing was stored or handed out; the same request can be sent again.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "OUTCOME_UNKNOWN: It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/allocation-number": {
      "post": {
        "operationId": "recordAllocationNumber",
        "tags": [
          "Documents"
        ],
        "summary": "Record the allocation number of a tax invoice",
        "description": "The business obtained an allocation number from the Tax Authority itself and the client system passes it on [ALC-05, ALC-06]. This service does not ask the Authority for a number. The number is recorded once, beside the document, and the document itself does not change: every copy rendered from then on prints it under \"הקצאה מספר:\", and so does the \"מקור\" while it has not left the business [ALC-08]. A document of type 305, 320 or 330 takes a number; a receipt and a transaction invoice never do.\n\nSend the whole number, 9 to 40 digits. The answer carries the nine rightmost digits as shortNumber, the ones a detailed VAT report states [ALC-09]. The same number sent again answers 201 with repeated true and writes nothing. INPUT_INVALID names the reason in details.reason: \"number-format\", \"document-type\", or \"already-recorded\" when the document already has another number (a number is never replaced). When originalReleased is true the original had already left, and the number is on copies only.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "An allocation number the business obtained itself.",
                "properties": {
                  "number": {
                    "type": "string",
                    "maxLength": 40,
                    "minLength": 9,
                    "description": "The whole allocation number as the Authority gave it: 9 to 40 digits."
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The number is recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "documentId": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The document."
                    },
                    "allocationNumber": {
                      "type": "string",
                      "maxLength": 40,
                      "description": "The whole number as stored."
                    },
                    "shortNumber": {
                      "type": "string",
                      "maxLength": 9,
                      "description": "The nine rightmost digits [ALC-09]."
                    },
                    "recordedAt": {
                      "type": "string",
                      "maxLength": 30,
                      "format": "date-time",
                      "description": "When the number was recorded. ISO 8601, UTC."
                    },
                    "originalReleased": {
                      "type": "boolean",
                      "description": "True when the original had already left the business: the number is on copies only."
                    },
                    "repeated": {
                      "type": "boolean",
                      "description": "True when this very number was already recorded and nothing was written again."
                    }
                  },
                  "required": [
                    "documentId",
                    "allocationNumber",
                    "shortNumber",
                    "recordedAt",
                    "originalReleased",
                    "repeated"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DOCUMENT_CANCELLED: The document is cancelled. Nothing of it is sent to anyone; the business can fetch its \"מבוטל\" view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DATABASE_REFUSED: The database refused the request. Nothing was issued, stored or handed out.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "DELIVER_TIMEOUT: The time limit passed. Nothing was stored or handed out; the same request can be sent again.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "OUTCOME_UNKNOWN: It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/delivery": {
      "get": {
        "operationId": "getDeliveryRecord",
        "tags": [
          "Delivery"
        ],
        "summary": "What happened to a document after it was issued",
        "description": "The links of the document (never their tokens), the messages that carried them and what became of each, every file that was handed out and to whom, when the \"מקור\" left the business, and the cancellation [SIG-17]. Each read is written to the audit log of the business.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryRecord"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/customers": {
      "get": {
        "operationId": "listCustomers",
        "tags": [
          "Customers"
        ],
        "summary": "The customers of a business",
        "description": "In the order of their keys. \"externalRef\" finds the customer this client created under that reference.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "externalRef",
            "in": "query",
            "required": false,
            "description": "The identifier of one customer in the caller's own system.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of customers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of customers.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "Pass as \"cursor\" to read the next page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/customers/{customerKey}": {
      "get": {
        "operationId": "getCustomer",
        "tags": [
          "Customers"
        ],
        "summary": "One customer",
        "description": "The record of the customer as it stands now. A document carries its own copy of the details as they were printed.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "customerKey",
            "in": "path",
            "required": true,
            "description": "The stable key of the customer.",
            "schema": {
              "type": "string",
              "maxLength": 15,
              "pattern": "^[A-Za-z0-9_.-]{1,15}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/uniform-exports": {
      "post": {
        "operationId": "produceUniformExport",
        "tags": [
          "Uniform file"
        ],
        "summary": "Produce the uniform-structure files for a date range",
        "description": "Reads the permanent file of the business in one snapshot, writes INI.TXT and BKMVDATA.TXT, checks them, and stores the production. The answer describes the production and carries the two reports of the specification; the files themselves are the download of the production.\n\nTransmission: right after the production is stored its transmission to the Tax Authority starts, as the transmission addendum demands of every production (1.2). \"transmission\" says where it stands when the answer leaves: approved, uploaded and waiting for the Authority, or stopped with its reason (the business is not connected, for example); it goes on through the routes of the transmission. It is null where the deployment transmits nothing. A refused or stopped transmission does not undo the production.\n\nIdempotency: the Idempotency-Key header is required, 1 to 255 printable ASCII characters, chosen by the caller, one per production it means to make. The same key with the same business and range returns the production it made the first time, with the same reports (\"replayed\": true, 200), and produces nothing: so after a lost answer, send the same request again. The same key with another business or another range is refused (IDEMPOTENCY_KEY_REUSED). A request that was refused stored nothing and its key is free. Two different keys are two productions, each with its own primary identifier and directory.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chosen by the caller: one key per production it means to make.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "records"
            ]
          }
        ],
        "x-required-scope": "records",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The date range, both ends included, by document date, and the drive.",
                "properties": {
                  "from": {
                    "type": "string",
                    "maxLength": 10,
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                    "description": "First document date of the range. \"YYYY-MM-DD\"."
                  },
                  "to": {
                    "type": "string",
                    "maxLength": 10,
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                    "description": "Last document date of the range. Not after today in Israel. \"YYYY-MM-DD\"."
                  },
                  "drive": {
                    "type": "string",
                    "maxLength": 1,
                    "pattern": "^[A-Za-z]$",
                    "description": "The drive the user saves the directory tree on, one letter A to Z (specification 2.1(ג)(2) and 5.4). Field 1012 and the end-of-process report state the path on it. Left out: C."
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key was used before with this same request: the production it made then.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the Idempotency-Key had been used before with this same request: this is the production it made then, and nothing was produced now."
                    },
                    "export": {
                      "$ref": "#/components/schemas/UniformExport"
                    },
                    "endOfProcessReport": {
                      "$ref": "#/components/schemas/EndOfProcessReport"
                    },
                    "documentsReport": {
                      "$ref": "#/components/schemas/DocumentsReport"
                    },
                    "transmission": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Where the transmission of one stored production to the Tax Authority stands. Read from what was recorded; reading it asks the Authority nothing.",
                      "properties": {
                        "exportId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The stored production."
                        },
                        "issuerId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The business."
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "not-sent",
                            "incomplete",
                            "uploaded",
                            "approved",
                            "rejected",
                            "no-requirement",
                            "refused",
                            "failed"
                          ],
                          "description": "not-sent: nothing was ever sent. incomplete: the latest attempt has its links and not yet both files. uploaded: both files are with the Authority, not yet decided. approved. rejected: the Authority rejected a file; reasons says why. no-requirement: the Authority asks no file of this business for this period. refused: the Authority refused a request. failed: a fault of the Authority, or no answer."
                        },
                        "next": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "send",
                            "resume",
                            "check-status",
                            "sign-in",
                            "none"
                          ],
                          "description": "What to do next: send, resume or check-status (all three are the same POST), sign-in (the owner signs in at the Authority, in the portal), or none."
                        },
                        "attempts": {
                          "type": "integer",
                          "description": "How many times the production was sent."
                        },
                        "remoteSetId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 200,
                          "description": "The identifier the Authority gave the latest set of links."
                        },
                        "files": {
                          "type": "object",
                          "properties": {
                            "ini": {
                              "type": "object",
                              "properties": {
                                "uploaded": {
                                  "type": "boolean",
                                  "description": "True when the whole content was accepted by the upload service in the latest attempt."
                                },
                                "remoteFileId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 200,
                                  "description": "The identifier the Authority gave the file."
                                },
                                "remoteFileName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 300,
                                  "description": "The name the Authority gave the file."
                                },
                                "sentBytes": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "description": "Bytes sent."
                                },
                                "sentSha256": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 64,
                                  "description": "SHA-256 of what was sent, hex."
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 100,
                                  "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 2000,
                                  "description": "The reason of a rejection, as received."
                                },
                                "uploadedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The upload date of the status answer, as received."
                                },
                                "updatedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The update date of the status answer, as received."
                                },
                                "statusCheckedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 30,
                                  "format": "date-time",
                                  "description": "When the status was last asked. ISO 8601, UTC."
                                }
                              },
                              "required": [
                                "uploaded",
                                "remoteFileId",
                                "remoteFileName",
                                "sentBytes",
                                "sentSha256",
                                "status",
                                "description",
                                "uploadedDate",
                                "updatedDate",
                                "statusCheckedAt"
                              ],
                              "additionalProperties": false
                            },
                            "bkm": {
                              "type": "object",
                              "properties": {
                                "uploaded": {
                                  "type": "boolean",
                                  "description": "True when the whole content was accepted by the upload service in the latest attempt."
                                },
                                "remoteFileId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 200,
                                  "description": "The identifier the Authority gave the file."
                                },
                                "remoteFileName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 300,
                                  "description": "The name the Authority gave the file."
                                },
                                "sentBytes": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "description": "Bytes sent."
                                },
                                "sentSha256": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 64,
                                  "description": "SHA-256 of what was sent, hex."
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 100,
                                  "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 2000,
                                  "description": "The reason of a rejection, as received."
                                },
                                "uploadedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The upload date of the status answer, as received."
                                },
                                "updatedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The update date of the status answer, as received."
                                },
                                "statusCheckedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 30,
                                  "format": "date-time",
                                  "description": "When the status was last asked. ISO 8601, UTC."
                                }
                              },
                              "required": [
                                "uploaded",
                                "remoteFileId",
                                "remoteFileName",
                                "sentBytes",
                                "sentSha256",
                                "status",
                                "description",
                                "uploadedDate",
                                "updatedDate",
                                "statusCheckedAt"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "ini",
                            "bkm"
                          ],
                          "additionalProperties": false
                        },
                        "reasons": {
                          "type": "array",
                          "description": "What the Authority said about the latest refusal or rejection [TRX-18].",
                          "items": {
                            "type": "string",
                            "maxLength": 4000,
                            "description": "The words of the Authority, as received."
                          }
                        },
                        "lastProblem": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "seq": {
                              "type": "integer",
                              "description": "Order of the recorded steps."
                            },
                            "attempt": {
                              "type": "integer",
                              "description": "The attempt the step belongs to, from 1."
                            },
                            "step": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "links",
                                "start",
                                "upload",
                                "status"
                              ],
                              "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
                            },
                            "file": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 3,
                              "enum": [
                                "ini",
                                "bkm",
                                null
                              ],
                              "description": "ini or bkm; null on the links step."
                            },
                            "outcome": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "ok",
                                "refused",
                                "failed",
                                "unknown"
                              ],
                              "description": "ok, refused, failed or unknown."
                            },
                            "reason": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64,
                              "description": "Short name of what happened when the step did not end ok."
                            },
                            "httpStatus": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "description": "The HTTP status of the answer."
                            },
                            "fileStatus": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 100,
                              "description": "The status value, on a status step."
                            },
                            "said": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 4000,
                              "description": "What the Authority said, word for word, when the step did not end well."
                            },
                            "sentAt": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the request left. ISO 8601, UTC."
                            },
                            "recordedAt": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the step was recorded. ISO 8601, UTC."
                            }
                          },
                          "required": [
                            "seq",
                            "attempt",
                            "step",
                            "file",
                            "outcome",
                            "reason",
                            "httpStatus",
                            "fileStatus",
                            "said",
                            "sentAt",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "steps": {
                          "type": "array",
                          "description": "Every recorded request and its answer, in order.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "seq": {
                                "type": "integer",
                                "description": "Order of the recorded steps."
                              },
                              "attempt": {
                                "type": "integer",
                                "description": "The attempt the step belongs to, from 1."
                              },
                              "step": {
                                "type": "string",
                                "maxLength": 10,
                                "enum": [
                                  "links",
                                  "start",
                                  "upload",
                                  "status"
                                ],
                                "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
                              },
                              "file": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 3,
                                "enum": [
                                  "ini",
                                  "bkm",
                                  null
                                ],
                                "description": "ini or bkm; null on the links step."
                              },
                              "outcome": {
                                "type": "string",
                                "maxLength": 10,
                                "enum": [
                                  "ok",
                                  "refused",
                                  "failed",
                                  "unknown"
                                ],
                                "description": "ok, refused, failed or unknown."
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 64,
                                "description": "Short name of what happened when the step did not end ok."
                              },
                              "httpStatus": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The HTTP status of the answer."
                              },
                              "fileStatus": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 100,
                                "description": "The status value, on a status step."
                              },
                              "said": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 4000,
                                "description": "What the Authority said, word for word, when the step did not end well."
                              },
                              "sentAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request left. ISO 8601, UTC."
                              },
                              "recordedAt": {
                                "type": "string",
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the step was recorded. ISO 8601, UTC."
                              }
                            },
                            "required": [
                              "seq",
                              "attempt",
                              "step",
                              "file",
                              "outcome",
                              "reason",
                              "httpStatus",
                              "fileStatus",
                              "said",
                              "sentAt",
                              "recordedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "exportId",
                        "issuerId",
                        "status",
                        "next",
                        "attempts",
                        "remoteSetId",
                        "files",
                        "reasons",
                        "lastProblem",
                        "steps"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "replayed",
                    "export",
                    "endOfProcessReport",
                    "documentsReport",
                    "transmission"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The production was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when the Idempotency-Key had been used before with this same request: this is the production it made then, and nothing was produced now."
                    },
                    "export": {
                      "$ref": "#/components/schemas/UniformExport"
                    },
                    "endOfProcessReport": {
                      "$ref": "#/components/schemas/EndOfProcessReport"
                    },
                    "documentsReport": {
                      "$ref": "#/components/schemas/DocumentsReport"
                    },
                    "transmission": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Where the transmission of one stored production to the Tax Authority stands. Read from what was recorded; reading it asks the Authority nothing.",
                      "properties": {
                        "exportId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The stored production."
                        },
                        "issuerId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The business."
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "not-sent",
                            "incomplete",
                            "uploaded",
                            "approved",
                            "rejected",
                            "no-requirement",
                            "refused",
                            "failed"
                          ],
                          "description": "not-sent: nothing was ever sent. incomplete: the latest attempt has its links and not yet both files. uploaded: both files are with the Authority, not yet decided. approved. rejected: the Authority rejected a file; reasons says why. no-requirement: the Authority asks no file of this business for this period. refused: the Authority refused a request. failed: a fault of the Authority, or no answer."
                        },
                        "next": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "send",
                            "resume",
                            "check-status",
                            "sign-in",
                            "none"
                          ],
                          "description": "What to do next: send, resume or check-status (all three are the same POST), sign-in (the owner signs in at the Authority, in the portal), or none."
                        },
                        "attempts": {
                          "type": "integer",
                          "description": "How many times the production was sent."
                        },
                        "remoteSetId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 200,
                          "description": "The identifier the Authority gave the latest set of links."
                        },
                        "files": {
                          "type": "object",
                          "properties": {
                            "ini": {
                              "type": "object",
                              "properties": {
                                "uploaded": {
                                  "type": "boolean",
                                  "description": "True when the whole content was accepted by the upload service in the latest attempt."
                                },
                                "remoteFileId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 200,
                                  "description": "The identifier the Authority gave the file."
                                },
                                "remoteFileName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 300,
                                  "description": "The name the Authority gave the file."
                                },
                                "sentBytes": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "description": "Bytes sent."
                                },
                                "sentSha256": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 64,
                                  "description": "SHA-256 of what was sent, hex."
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 100,
                                  "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 2000,
                                  "description": "The reason of a rejection, as received."
                                },
                                "uploadedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The upload date of the status answer, as received."
                                },
                                "updatedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The update date of the status answer, as received."
                                },
                                "statusCheckedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 30,
                                  "format": "date-time",
                                  "description": "When the status was last asked. ISO 8601, UTC."
                                }
                              },
                              "required": [
                                "uploaded",
                                "remoteFileId",
                                "remoteFileName",
                                "sentBytes",
                                "sentSha256",
                                "status",
                                "description",
                                "uploadedDate",
                                "updatedDate",
                                "statusCheckedAt"
                              ],
                              "additionalProperties": false
                            },
                            "bkm": {
                              "type": "object",
                              "properties": {
                                "uploaded": {
                                  "type": "boolean",
                                  "description": "True when the whole content was accepted by the upload service in the latest attempt."
                                },
                                "remoteFileId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 200,
                                  "description": "The identifier the Authority gave the file."
                                },
                                "remoteFileName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 300,
                                  "description": "The name the Authority gave the file."
                                },
                                "sentBytes": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "description": "Bytes sent."
                                },
                                "sentSha256": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 64,
                                  "description": "SHA-256 of what was sent, hex."
                                },
                                "status": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 100,
                                  "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 2000,
                                  "description": "The reason of a rejection, as received."
                                },
                                "uploadedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The upload date of the status answer, as received."
                                },
                                "updatedDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 40,
                                  "description": "The update date of the status answer, as received."
                                },
                                "statusCheckedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 30,
                                  "format": "date-time",
                                  "description": "When the status was last asked. ISO 8601, UTC."
                                }
                              },
                              "required": [
                                "uploaded",
                                "remoteFileId",
                                "remoteFileName",
                                "sentBytes",
                                "sentSha256",
                                "status",
                                "description",
                                "uploadedDate",
                                "updatedDate",
                                "statusCheckedAt"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "ini",
                            "bkm"
                          ],
                          "additionalProperties": false
                        },
                        "reasons": {
                          "type": "array",
                          "description": "What the Authority said about the latest refusal or rejection [TRX-18].",
                          "items": {
                            "type": "string",
                            "maxLength": 4000,
                            "description": "The words of the Authority, as received."
                          }
                        },
                        "lastProblem": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "seq": {
                              "type": "integer",
                              "description": "Order of the recorded steps."
                            },
                            "attempt": {
                              "type": "integer",
                              "description": "The attempt the step belongs to, from 1."
                            },
                            "step": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "links",
                                "start",
                                "upload",
                                "status"
                              ],
                              "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
                            },
                            "file": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 3,
                              "enum": [
                                "ini",
                                "bkm",
                                null
                              ],
                              "description": "ini or bkm; null on the links step."
                            },
                            "outcome": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "ok",
                                "refused",
                                "failed",
                                "unknown"
                              ],
                              "description": "ok, refused, failed or unknown."
                            },
                            "reason": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64,
                              "description": "Short name of what happened when the step did not end ok."
                            },
                            "httpStatus": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "description": "The HTTP status of the answer."
                            },
                            "fileStatus": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 100,
                              "description": "The status value, on a status step."
                            },
                            "said": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 4000,
                              "description": "What the Authority said, word for word, when the step did not end well."
                            },
                            "sentAt": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the request left. ISO 8601, UTC."
                            },
                            "recordedAt": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the step was recorded. ISO 8601, UTC."
                            }
                          },
                          "required": [
                            "seq",
                            "attempt",
                            "step",
                            "file",
                            "outcome",
                            "reason",
                            "httpStatus",
                            "fileStatus",
                            "said",
                            "sentAt",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "steps": {
                          "type": "array",
                          "description": "Every recorded request and its answer, in order.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "seq": {
                                "type": "integer",
                                "description": "Order of the recorded steps."
                              },
                              "attempt": {
                                "type": "integer",
                                "description": "The attempt the step belongs to, from 1."
                              },
                              "step": {
                                "type": "string",
                                "maxLength": 10,
                                "enum": [
                                  "links",
                                  "start",
                                  "upload",
                                  "status"
                                ],
                                "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
                              },
                              "file": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 3,
                                "enum": [
                                  "ini",
                                  "bkm",
                                  null
                                ],
                                "description": "ini or bkm; null on the links step."
                              },
                              "outcome": {
                                "type": "string",
                                "maxLength": 10,
                                "enum": [
                                  "ok",
                                  "refused",
                                  "failed",
                                  "unknown"
                                ],
                                "description": "ok, refused, failed or unknown."
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 64,
                                "description": "Short name of what happened when the step did not end ok."
                              },
                              "httpStatus": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The HTTP status of the answer."
                              },
                              "fileStatus": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 100,
                                "description": "The status value, on a status step."
                              },
                              "said": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 4000,
                                "description": "What the Authority said, word for word, when the step did not end well."
                              },
                              "sentAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request left. ISO 8601, UTC."
                              },
                              "recordedAt": {
                                "type": "string",
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the step was recorded. ISO 8601, UTC."
                              }
                            },
                            "required": [
                              "seq",
                              "attempt",
                              "step",
                              "file",
                              "outcome",
                              "reason",
                              "httpStatus",
                              "fileStatus",
                              "said",
                              "sentAt",
                              "recordedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "exportId",
                        "issuerId",
                        "status",
                        "next",
                        "attempts",
                        "remoteSetId",
                        "files",
                        "reasons",
                        "lastProblem",
                        "steps"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "replayed",
                    "export",
                    "endOfProcessReport",
                    "documentsReport",
                    "transmission"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DEALER_NUMBER_CHANGED_IN_RANGE: Documents of the range were issued under different dealer numbers. Produce each period apart.\n\nIDEMPOTENCY_KEY_REUSED: The Idempotency-Key was already used with a different request.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_INVALID: The Idempotency-Key header is missing or is not 1 to 255 printable ASCII characters.\n\nINVALID_INPUT: The range is not two calendar dates in order that end no later than today in Israel; details.field names the one at fault.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.\n\nVALUE_REFUSED: A stored value cannot be written exactly into its field of the file; details.field names it. Nothing was produced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "CONSISTENCY_CHECK_FAILED: The files were built and did not pass their own check. Nothing was produced.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "DIRECTORY_UNAVAILABLE: No free directory name was found for this production. Try again later.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listUniformExports",
        "tags": [
          "Uniform file"
        ],
        "summary": "The stored productions of a business",
        "description": "Newest first. What each production is, without its files.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of productions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of productions.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UniformExport"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "Pass as \"cursor\" to read the next page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/uniform-exports/{exportId}/download": {
      "get": {
        "operationId": "downloadUniformExport",
        "tags": [
          "Uniform file"
        ],
        "summary": "The files of a stored production, as one ZIP",
        "description": "The directory tree of the specification in one download: OPENFRMT/<dealer>.<YY>/<MMDDhhmm>/INI.TXT and BKMVDATA.zip, byte for byte as they were produced. The stored bytes are checked against their hashes before they leave. Each download is written to the audit log of the business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "description": "The production.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The ZIP.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nSTORED_PRODUCTION_DAMAGED: The stored production no longer matches the hashes it was stored with. Nothing is handed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/reports/documents": {
      "get": {
        "operationId": "getDocumentsReport",
        "tags": [
          "Uniform file"
        ],
        "summary": "The 2.6 report: documents per type in a date range",
        "description": "Count and total of the documents of every type in the range, without producing files. \"format\" chooses JSON (default), the plain text form, or one self-contained HTML page. Each call is written to the audit log of the business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "First document date of the range. \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Last document date of the range. Not after today in Israel.",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default), text or html.",
            "schema": {
              "type": "string",
              "maxLength": 4,
              "enum": [
                "json",
                "text",
                "html"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The report. With format=text or format=html, that rendering instead of JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentsReport"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_INPUT: The range is not two calendar dates in order that end no later than today in Israel; details.field names the one at fault.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/uniform-exports/{exportId}/transmission": {
      "post": {
        "operationId": "transmitUniformExport",
        "tags": [
          "Transmission"
        ],
        "summary": "Transmit a stored production to the Tax Authority, or go on with its transmission",
        "description": "Call it right after a production was stored [TRX-01]. The same call is \"send\", \"send again\" and \"continue\": what it does is decided from what was recorded. Never sent, or the last attempt ended: a new attempt. An attempt that has its links and not yet both files: it goes on from the file that is missing. Both files uploaded: nothing is sent again and the status is asked. Approved: nothing is requested. The stored files are sent as they are; nothing is ever produced again [TRX-18].\n\nRepeating is safe. The answer of the Authority that it asks no file of this business for this period is a normal end (state.status \"no-requirement\", 200). A call that could not finish answers with the code of what stopped it, and everything that was done is recorded: read the state with the GET of this path, where the words of the Authority are kept in full. The four codes to tell apart: AUTHORITY_REFUSED and FILE_TOO_LARGE (the Authority said no; details.reasons), AUTHORITY_UNREACHABLE (no answer; send again later), SIGN_IN_REQUIRED (details.connection \"files\": the owner of the business signs in at the Authority for sending, in the portal, on the page of the production; that sign-in lasts two hours, and the portal sends the production right after it), PRODUCTION_SWITCHED_OFF.\n\nThe call lasts as long as the upload does: minutes for a large file.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "description": "The stored production.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "records"
            ]
          }
        ],
        "x-required-scope": "records",
        "responses": {
          "200": {
            "description": "The call ran to its end; state says where the transmission stands.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean",
                      "description": "True when this call sent something of the files to the Authority; false when nothing had to be sent."
                    },
                    "state": {
                      "$ref": "#/components/schemas/TransmissionState"
                    }
                  },
                  "required": [
                    "sent",
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.\n\nTRANSMISSION_IN_PROGRESS: Another call is transmitting this production at this moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nFILE_TOO_LARGE: The file is larger than the Tax Authority allows for this business. It was not sent; details.supportAddress is where the business may write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nSTORED_PRODUCTION_DAMAGED: The stored production no longer matches the hashes it was stored with. Nothing is handed out.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getTransmission",
        "tags": [
          "Transmission"
        ],
        "summary": "Where the transmission of a production stands",
        "description": "Read from what was recorded: the status, what to do next, both files, the words of the Authority about a refusal or a rejection [TRX-18], and every step in order. Nothing is asked of the Authority by this call.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "description": "The stored production.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransmissionState"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/uniform-exports/{exportId}/transmission/status": {
      "post": {
        "operationId": "checkTransmissionStatus",
        "tags": [
          "Transmission"
        ],
        "summary": "Ask the Tax Authority for the status of a transmitted production",
        "description": "For a production whose two files were uploaded and that is not yet approved or rejected: asks the status service again and records its answer [TRX-11, TRX-12]. For a production that is not at that point nothing is requested and its state comes back. The service also asks by itself from time to time; this call is for a caller that wants the answer now.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "description": "The stored production.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "records"
            ]
          }
        ],
        "x-required-scope": "records",
        "responses": {
          "200": {
            "description": "The state after the answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean",
                      "description": "True when this call sent something of the files to the Authority; false when nothing had to be sent."
                    },
                    "state": {
                      "$ref": "#/components/schemas/TransmissionState"
                    }
                  },
                  "required": [
                    "sent",
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.\n\nTRANSMISSION_IN_PROGRESS: Another call is transmitting this production at this moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/authority-connection": {
      "get": {
        "operationId": "getAuthorityConnection",
        "tags": [
          "Transmission"
        ],
        "summary": "Whether a business is connected to the Tax Authority",
        "description": "The allocation numbers and the checks of a received invoice need the long connection of the business: its owner signs in at the Tax Authority once, in the portal of the product, and again before the permission ends (three months). This call tells whether that connection stands and by when a new sign-in is needed. Sending a uniform file needs a second, short connection whose sign-in lasts two hours, made in the portal when the file is sent; this call does not describe it, and the state of a transmission says \"sign-in\" when it is needed. It never returns a token, and there is no call that takes one.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The connection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorityConnection"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/allocation": {
      "post": {
        "operationId": "requestAllocationNumber",
        "tags": [
          "Allocation"
        ],
        "summary": "Ask the Tax Authority for the allocation number of a tax invoice",
        "description": "For an issued tax invoice (305, 320) of a business whose owner signed in at the Tax Authority in the portal of the product [ALC-11, ALC-19]. Also for a transaction invoice (300) of a licensed dealer that corrects nothing: it is asked about as the preliminary document \"חשבון עסקה/פרופורמה\" (code 332) whose \"אישור הקצאה\" the buyer may check before paying; the number is printed on it as \"אישור הקצאה מספר:\" with the sentence \"לא ניתן לקזז מס תשומות בגין מסמך זה\", and a held one offers every alternative but a reverse charge [ALC-25]. A tax invoice that names such a transaction invoice among its related documents is tied to it on its first request (action 4, the invoice_id of the preliminary document), as long as the tax invoices tied to it do not pass its amount without VAT together. The request carries the number and the amounts of the document as they stand in the permanent file; the caller sends nothing of them.\n\nA number: it is stored once, beside the document, and printed from then on under \"הקצאה מספר:\" [ALC-08]. `original` says what became of the original: \"stored\" (a further original that shows the number was stored, because the original had not left), \"released\" (the original had left: the number is on copies only), \"deferred\" (the original that shows it is made at the first download).\n\nAn invoice the Authority held is not an error: the answer is 200, state.status is \"held\", and state.alternatives lists the four alternatives to show the business [ALC-21]; report its choice with the allocation-decision call. Wrong data is AUTHORITY_REFUSED with details.kind \"wrong-data\", details.codes and the words of the Authority in details.reasons. No permission is AUTHORITY_REFUSED with details.kind \"permission\". AUTHORITY_UNREACHABLE and AUTHORITY_FAILED mean nothing is known: the same call is safe to repeat, it carries the same invoice_id, and the service repeats it by itself with growing waits [ALC-22].\n\nNothing is sent, and INPUT_INVALID names the reason in details.reason, for a document that takes no number (\"document-type\"), one that holds only exempt or zero-rate transactions (\"not-taxed\") [ALC-03], one whose buyer has no dealer number (\"customer-number-missing\"), and one the business abandoned or replaced. A document that has its number answers 200 with sent false.\n\npreliminaryInvoiceId is for a tax invoice that originates in a preliminary document which received an allocation approval outside this service: the request then carries that identifier and action 4 [ALC-13].",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "May be left out or empty.",
                "properties": {
                  "preliminaryInvoiceId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 50,
                    "minLength": 1,
                    "description": "The invoice_id of the preliminary document, as it was reported to the Authority."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The call ran to its end; state says where the allocation stands.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean",
                      "description": "True when this call sent a request to the Authority."
                    },
                    "original": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 10,
                      "enum": [
                        "stored",
                        "released",
                        "deferred",
                        null
                      ],
                      "description": "What became of the original when a number arrived in this call; null otherwise."
                    },
                    "state": {
                      "type": "object",
                      "description": "Where the allocation number of one document stands. Read from what was recorded; reading it asks the Authority nothing.",
                      "properties": {
                        "documentId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The document."
                        },
                        "issuerId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The business."
                        },
                        "docType": {
                          "type": "integer",
                          "description": "The type of the document."
                        },
                        "documentNumber": {
                          "type": "string",
                          "maxLength": 20,
                          "description": "The number of the document."
                        },
                        "cancelled": {
                          "type": "boolean",
                          "description": "True when the document is cancelled."
                        },
                        "need": {
                          "type": "object",
                          "description": "Whether the law requires an allocation number for this document. A number may be asked for any taxed tax invoice, required or not.",
                          "properties": {
                            "required": {
                              "type": "boolean",
                              "description": "True when all three hold: the amount without VAT is above the amount in force on the document date, a transaction of the document is taxed at a rate above zero, and the buyer demanded a number [ALC-01]."
                            },
                            "aboveThreshold": {
                              "type": "boolean",
                              "description": "The amount without VAT is above the amount in force on the document date [ALC-02]."
                            },
                            "threshold": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 20,
                              "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                              "description": "The amount in force on the document date. Decimal text with exactly two decimals, never a JSON number."
                            },
                            "taxed": {
                              "type": "boolean",
                              "description": "A transaction of the document is taxed at a rate above zero. A document without one is never asked about [ALC-03]."
                            },
                            "buyerDemanded": {
                              "type": "boolean",
                              "description": "The buyer demanded a number, as recorded on the document."
                            }
                          },
                          "required": [
                            "required",
                            "aboveThreshold",
                            "threshold",
                            "taxed",
                            "buyerDemanded"
                          ],
                          "additionalProperties": false
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "not-applicable",
                            "not-asked",
                            "allocated",
                            "held",
                            "decided",
                            "wrong-data",
                            "refused",
                            "pending"
                          ],
                          "description": "not-applicable: the document never takes a number through this service (a receipt, a credit note, a transaction invoice of an exempt dealer or one that corrects another). not-asked: never asked about; a transaction invoice of a licensed dealer stays here until the business asks for its approval as a preliminary document [ALC-25]. allocated: it has its number. held: the Authority held the invoice and the business has not chosen. decided: the business chose; decision says what. wrong-data: the Authority found a fault in the data of the request; errors says which. refused: the Authority refused the caller. pending: the last request met a fault or got no answer, and is asked again."
                        },
                        "next": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "none",
                            "ask",
                            "choose",
                            "retry",
                            "sign-in",
                            "ask-again",
                            "report-decision"
                          ],
                          "description": "What to do next. none. ask: ask for a number. choose: show the business the alternatives and report its choice. retry: the service asks again by itself; asking now is safe. sign-in: the owner of the business signs in at the Authority, in the portal. ask-again: after a hearing that released the invoice, ask again. report-decision: the choice was stored and its report did not arrive; send the same choice again."
                        },
                        "allocationNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 40,
                          "description": "The whole allocation number."
                        },
                        "shortNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 9,
                          "description": "Its nine rightmost digits: the ones a detailed VAT report states [ALC-09]."
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10,
                          "enum": [
                            "manual",
                            "service",
                            null
                          ],
                          "description": "manual: the business typed the number in. service: this service obtained it."
                        },
                        "numberRecordedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the number was recorded. ISO 8601, UTC."
                        },
                        "invoiceId": {
                          "type": "string",
                          "maxLength": 50,
                          "description": "The invoice_id every request of this document carries [ALC-11]."
                        },
                        "held": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "code": {
                              "type": "integer",
                              "description": "460 or 461, as the Authority answered."
                            },
                            "at": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the Authority held the invoice. ISO 8601, UTC."
                            }
                          },
                          "required": [
                            "code",
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        "decision": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "alternative": {
                              "type": "string",
                              "maxLength": 20,
                              "enum": [
                                "cancel",
                                "continue",
                                "reverse_charge",
                                "hearing"
                              ],
                              "description": "What the business chose."
                            },
                            "chosenAt": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the choice was stored. ISO 8601, UTC."
                            },
                            "report": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "reported",
                                "pending",
                                "refused"
                              ],
                              "description": "reported: the Authority accepted the report. pending: the report did not arrive yet and is sent again. refused: the Authority refused the report; steps holds its words."
                            },
                            "replacementDocumentId": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 36,
                              "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}$",
                              "description": "On a reverse charge: the zero-rate invoice that replaced this one."
                            }
                          },
                          "required": [
                            "alternative",
                            "chosenAt",
                            "report",
                            "replacementDocumentId"
                          ],
                          "additionalProperties": false
                        },
                        "alternatives": {
                          "type": "array",
                          "description": "The four alternatives after the Authority held the invoice [ALC-21]; empty unless one may be chosen now. Show all four to the business.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "alternative": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "cancel",
                                  "continue",
                                  "reverse_charge",
                                  "hearing"
                                ],
                                "description": "The alternative."
                              },
                              "order": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 4,
                                "description": "Its place among the four, as the Authority lists them."
                              },
                              "reportedTo": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "Cancel",
                                  "Continue",
                                  "Approval",
                                  "FurtherObjection"
                                ],
                                "description": "Where the choice is reported."
                              },
                              "available": {
                                "type": "boolean",
                                "description": "False when it cannot be chosen now."
                              },
                              "unavailableReason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "enum": [
                                  "buyer-number-missing",
                                  "already-chosen",
                                  "not-after-this-choice",
                                  "not-for-preliminary",
                                  null
                                ],
                                "description": "Why not. not-for-preliminary: a reverse charge is no alternative for the approval of a preliminary document [ALC-25]."
                              },
                              "followUp": {
                                "type": "string",
                                "maxLength": 30,
                                "enum": [
                                  "cancel-document",
                                  "credit-note",
                                  "correcting-invoice",
                                  "issue-zero-rate-invoice",
                                  "ask-for-hearing",
                                  "none"
                                ],
                                "description": "What the business does itself afterwards, by the regular calls of this API: cancel-document, credit-note (a tax invoice whose original has left), correcting-invoice (a transaction invoice whose original has left), issue-zero-rate-invoice, ask-for-hearing (at the Authority), or none."
                              }
                            },
                            "required": [
                              "alternative",
                              "order",
                              "reportedTo",
                              "available",
                              "unavailableReason",
                              "followUp"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "hearingUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 2048,
                          "description": "Where a hearing is asked for at the Authority, when the deployment knows the address [ALC-24]."
                        },
                        "errors": {
                          "type": "array",
                          "description": "The error list of the latest answer that carried one, as received [ALC-15].",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The code."
                              },
                              "message": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 4000,
                                "description": "The message, word for word."
                              },
                              "param": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 200,
                                "description": "The field it names."
                              },
                              "location": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 200,
                                "description": "The location it names."
                              }
                            },
                            "required": [
                              "code",
                              "message",
                              "param",
                              "location"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "original": {
                          "type": "object",
                          "properties": {
                            "released": {
                              "type": "boolean",
                              "description": "The original of the document has left the business."
                            },
                            "carriesNumber": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "True when the stored original shows the number. False when the number arrived after the original left. Null while there is no number."
                            }
                          },
                          "required": [
                            "released",
                            "carriesNumber"
                          ],
                          "additionalProperties": false
                        },
                        "numberOnCopiesOnly": {
                          "type": "boolean",
                          "description": "The number arrived after the original left: it is on copies only, and may be written on the original by hand."
                        },
                        "warnBeforeLink": {
                          "type": "boolean",
                          "description": "The law requires a number, the document has none, and its original has not left: warn the business before a link is sent, because the original that leaves will carry no number."
                        },
                        "noInputTaxDeduction": {
                          "type": "boolean",
                          "description": "Every rendering of the invoice says that input tax may not be deducted on it [ALC-22]."
                        },
                        "leaveOutOfDetailedVatReport": {
                          "type": "boolean",
                          "description": "True for an invoice the business abandoned after the Authority held it: the Authority instructs that neither the invoice nor its cancellation enters the detailed VAT report [ALC-24]."
                        },
                        "faults": {
                          "type": "integer",
                          "description": "Requests in a row that met a fault."
                        },
                        "nextRetryAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the service asks again by itself. ISO 8601, UTC."
                        },
                        "gaveUp": {
                          "type": "boolean",
                          "description": "The service stopped asking by itself after too many faults: ask again with the POST of this document."
                        },
                        "steps": {
                          "type": "array",
                          "description": "Every recorded request and its answer, in order.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "seq": {
                                "type": "integer",
                                "description": "The order of the recorded requests."
                              },
                              "service": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "approval",
                                  "cancel",
                                  "continue",
                                  "further_objection"
                                ],
                                "description": "approval: the request for a number. cancel, continue, further_objection: the report of a choice."
                              },
                              "attempt": {
                                "type": "integer",
                                "description": "The number of this request among the requests of the same service for the document."
                              },
                              "outcome": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "ok",
                                  "held",
                                  "decision_sent",
                                  "wrong_data",
                                  "refused",
                                  "failed",
                                  "unknown"
                                ],
                                "description": "ok: a number was given, or the report was accepted. held: the data are correct and the Authority gave no number (codes 460, 461). decision_sent: the Authority holds the invoice and already has the decision (462). wrong_data: the Authority found a fault in what was sent. refused: the Authority refused the caller (the token, the permission). failed: a fault of the Authority. unknown: no usable answer came."
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 64,
                                "description": "A short name of why the request did not end ok."
                              },
                              "httpStatus": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The HTTP status of the answer."
                              },
                              "errorCodes": {
                                "type": "array",
                                "description": "The codes of the error list, in its order [ALC-15].",
                                "items": {
                                  "type": "integer",
                                  "description": "A code of the error list of the answer."
                                }
                              },
                              "said": {
                                "type": "array",
                                "description": "What the Authority said, word for word, when the request did not end well.",
                                "items": {
                                  "type": "string",
                                  "maxLength": 4000,
                                  "description": "The words of the Authority, as received."
                                }
                              },
                              "action": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The field \"action\" of the request, when it carried one: 3 a reverse charge, 4 a tax invoice that originates in a preliminary document."
                              },
                              "originDocumentId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 36,
                                "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}$",
                                "description": "On the request of a reverse charge: the invoice that was held."
                              },
                              "batchId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 36,
                                "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}$",
                                "description": "Set when the request of this document travelled with other invoices in one request to MultiApproval: the steps of that request share it [ALC-26]."
                              },
                              "sentAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request left. ISO 8601, UTC."
                              },
                              "recordedAt": {
                                "type": "string",
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request was recorded. ISO 8601, UTC."
                              }
                            },
                            "required": [
                              "seq",
                              "service",
                              "attempt",
                              "outcome",
                              "reason",
                              "httpStatus",
                              "errorCodes",
                              "said",
                              "action",
                              "originDocumentId",
                              "batchId",
                              "sentAt",
                              "recordedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "documentId",
                        "issuerId",
                        "docType",
                        "documentNumber",
                        "cancelled",
                        "need",
                        "status",
                        "next",
                        "allocationNumber",
                        "shortNumber",
                        "source",
                        "numberRecordedAt",
                        "invoiceId",
                        "held",
                        "decision",
                        "alternatives",
                        "hearingUrl",
                        "errors",
                        "original",
                        "numberOnCopiesOnly",
                        "warnBeforeLink",
                        "noInputTaxDeduction",
                        "leaveOutOfDetailedVatReport",
                        "faults",
                        "nextRetryAt",
                        "gaveUp",
                        "steps"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "sent",
                    "original",
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "DOCUMENT_CANCELLED: The document is cancelled. Nothing of it is sent to anyone; the business can fetch its \"מבוטל\" view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getAllocation",
        "tags": [
          "Allocation"
        ],
        "summary": "Where the allocation number of a document stands",
        "description": "Read from what was recorded: whether the law requires a number, the number and its nine rightmost digits [ALC-09], a holding of the Authority and the alternatives after it, the choice and whether it was reported, the error list of the Authority word for word [ALC-15], and every request in order. Nothing is asked of the Authority by this call.\n\nwarnBeforeLink is true for an invoice that needs a number, has none, and whose original has not left: ask for the number before a link is made, or tell the business that the original that leaves will carry none.",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The document.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Where the allocation number of one document stands. Read from what was recorded; reading it asks the Authority nothing.",
                  "properties": {
                    "documentId": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The document."
                    },
                    "issuerId": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The business."
                    },
                    "docType": {
                      "type": "integer",
                      "description": "The type of the document."
                    },
                    "documentNumber": {
                      "type": "string",
                      "maxLength": 20,
                      "description": "The number of the document."
                    },
                    "cancelled": {
                      "type": "boolean",
                      "description": "True when the document is cancelled."
                    },
                    "need": {
                      "type": "object",
                      "description": "Whether the law requires an allocation number for this document. A number may be asked for any taxed tax invoice, required or not.",
                      "properties": {
                        "required": {
                          "type": "boolean",
                          "description": "True when all three hold: the amount without VAT is above the amount in force on the document date, a transaction of the document is taxed at a rate above zero, and the buyer demanded a number [ALC-01]."
                        },
                        "aboveThreshold": {
                          "type": "boolean",
                          "description": "The amount without VAT is above the amount in force on the document date [ALC-02]."
                        },
                        "threshold": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 20,
                          "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                          "description": "The amount in force on the document date. Decimal text with exactly two decimals, never a JSON number."
                        },
                        "taxed": {
                          "type": "boolean",
                          "description": "A transaction of the document is taxed at a rate above zero. A document without one is never asked about [ALC-03]."
                        },
                        "buyerDemanded": {
                          "type": "boolean",
                          "description": "The buyer demanded a number, as recorded on the document."
                        }
                      },
                      "required": [
                        "required",
                        "aboveThreshold",
                        "threshold",
                        "taxed",
                        "buyerDemanded"
                      ],
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 20,
                      "enum": [
                        "not-applicable",
                        "not-asked",
                        "allocated",
                        "held",
                        "decided",
                        "wrong-data",
                        "refused",
                        "pending"
                      ],
                      "description": "not-applicable: the document never takes a number through this service (a receipt, a credit note, a transaction invoice of an exempt dealer or one that corrects another). not-asked: never asked about; a transaction invoice of a licensed dealer stays here until the business asks for its approval as a preliminary document [ALC-25]. allocated: it has its number. held: the Authority held the invoice and the business has not chosen. decided: the business chose; decision says what. wrong-data: the Authority found a fault in the data of the request; errors says which. refused: the Authority refused the caller. pending: the last request met a fault or got no answer, and is asked again."
                    },
                    "next": {
                      "type": "string",
                      "maxLength": 20,
                      "enum": [
                        "none",
                        "ask",
                        "choose",
                        "retry",
                        "sign-in",
                        "ask-again",
                        "report-decision"
                      ],
                      "description": "What to do next. none. ask: ask for a number. choose: show the business the alternatives and report its choice. retry: the service asks again by itself; asking now is safe. sign-in: the owner of the business signs in at the Authority, in the portal. ask-again: after a hearing that released the invoice, ask again. report-decision: the choice was stored and its report did not arrive; send the same choice again."
                    },
                    "allocationNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 40,
                      "description": "The whole allocation number."
                    },
                    "shortNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 9,
                      "description": "Its nine rightmost digits: the ones a detailed VAT report states [ALC-09]."
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 10,
                      "enum": [
                        "manual",
                        "service",
                        null
                      ],
                      "description": "manual: the business typed the number in. service: this service obtained it."
                    },
                    "numberRecordedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 30,
                      "format": "date-time",
                      "description": "When the number was recorded. ISO 8601, UTC."
                    },
                    "invoiceId": {
                      "type": "string",
                      "maxLength": 50,
                      "description": "The invoice_id every request of this document carries [ALC-11]."
                    },
                    "held": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer",
                          "description": "460 or 461, as the Authority answered."
                        },
                        "at": {
                          "type": "string",
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the Authority held the invoice. ISO 8601, UTC."
                        }
                      },
                      "required": [
                        "code",
                        "at"
                      ],
                      "additionalProperties": false
                    },
                    "decision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "alternative": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "cancel",
                            "continue",
                            "reverse_charge",
                            "hearing"
                          ],
                          "description": "What the business chose."
                        },
                        "chosenAt": {
                          "type": "string",
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the choice was stored. ISO 8601, UTC."
                        },
                        "report": {
                          "type": "string",
                          "maxLength": 10,
                          "enum": [
                            "reported",
                            "pending",
                            "refused"
                          ],
                          "description": "reported: the Authority accepted the report. pending: the report did not arrive yet and is sent again. refused: the Authority refused the report; steps holds its words."
                        },
                        "replacementDocumentId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 36,
                          "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}$",
                          "description": "On a reverse charge: the zero-rate invoice that replaced this one."
                        }
                      },
                      "required": [
                        "alternative",
                        "chosenAt",
                        "report",
                        "replacementDocumentId"
                      ],
                      "additionalProperties": false
                    },
                    "alternatives": {
                      "type": "array",
                      "description": "The four alternatives after the Authority held the invoice [ALC-21]; empty unless one may be chosen now. Show all four to the business.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "alternative": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "cancel",
                              "continue",
                              "reverse_charge",
                              "hearing"
                            ],
                            "description": "The alternative."
                          },
                          "order": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 4,
                            "description": "Its place among the four, as the Authority lists them."
                          },
                          "reportedTo": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "Cancel",
                              "Continue",
                              "Approval",
                              "FurtherObjection"
                            ],
                            "description": "Where the choice is reported."
                          },
                          "available": {
                            "type": "boolean",
                            "description": "False when it cannot be chosen now."
                          },
                          "unavailableReason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 30,
                            "enum": [
                              "buyer-number-missing",
                              "already-chosen",
                              "not-after-this-choice",
                              "not-for-preliminary",
                              null
                            ],
                            "description": "Why not. not-for-preliminary: a reverse charge is no alternative for the approval of a preliminary document [ALC-25]."
                          },
                          "followUp": {
                            "type": "string",
                            "maxLength": 30,
                            "enum": [
                              "cancel-document",
                              "credit-note",
                              "correcting-invoice",
                              "issue-zero-rate-invoice",
                              "ask-for-hearing",
                              "none"
                            ],
                            "description": "What the business does itself afterwards, by the regular calls of this API: cancel-document, credit-note (a tax invoice whose original has left), correcting-invoice (a transaction invoice whose original has left), issue-zero-rate-invoice, ask-for-hearing (at the Authority), or none."
                          }
                        },
                        "required": [
                          "alternative",
                          "order",
                          "reportedTo",
                          "available",
                          "unavailableReason",
                          "followUp"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hearingUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 2048,
                      "description": "Where a hearing is asked for at the Authority, when the deployment knows the address [ALC-24]."
                    },
                    "errors": {
                      "type": "array",
                      "description": "The error list of the latest answer that carried one, as received [ALC-15].",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The code."
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 4000,
                            "description": "The message, word for word."
                          },
                          "param": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 200,
                            "description": "The field it names."
                          },
                          "location": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 200,
                            "description": "The location it names."
                          }
                        },
                        "required": [
                          "code",
                          "message",
                          "param",
                          "location"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "original": {
                      "type": "object",
                      "properties": {
                        "released": {
                          "type": "boolean",
                          "description": "The original of the document has left the business."
                        },
                        "carriesNumber": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the stored original shows the number. False when the number arrived after the original left. Null while there is no number."
                        }
                      },
                      "required": [
                        "released",
                        "carriesNumber"
                      ],
                      "additionalProperties": false
                    },
                    "numberOnCopiesOnly": {
                      "type": "boolean",
                      "description": "The number arrived after the original left: it is on copies only, and may be written on the original by hand."
                    },
                    "warnBeforeLink": {
                      "type": "boolean",
                      "description": "The law requires a number, the document has none, and its original has not left: warn the business before a link is sent, because the original that leaves will carry no number."
                    },
                    "noInputTaxDeduction": {
                      "type": "boolean",
                      "description": "Every rendering of the invoice says that input tax may not be deducted on it [ALC-22]."
                    },
                    "leaveOutOfDetailedVatReport": {
                      "type": "boolean",
                      "description": "True for an invoice the business abandoned after the Authority held it: the Authority instructs that neither the invoice nor its cancellation enters the detailed VAT report [ALC-24]."
                    },
                    "faults": {
                      "type": "integer",
                      "description": "Requests in a row that met a fault."
                    },
                    "nextRetryAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 30,
                      "format": "date-time",
                      "description": "When the service asks again by itself. ISO 8601, UTC."
                    },
                    "gaveUp": {
                      "type": "boolean",
                      "description": "The service stopped asking by itself after too many faults: ask again with the POST of this document."
                    },
                    "steps": {
                      "type": "array",
                      "description": "Every recorded request and its answer, in order.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "seq": {
                            "type": "integer",
                            "description": "The order of the recorded requests."
                          },
                          "service": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "approval",
                              "cancel",
                              "continue",
                              "further_objection"
                            ],
                            "description": "approval: the request for a number. cancel, continue, further_objection: the report of a choice."
                          },
                          "attempt": {
                            "type": "integer",
                            "description": "The number of this request among the requests of the same service for the document."
                          },
                          "outcome": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "ok",
                              "held",
                              "decision_sent",
                              "wrong_data",
                              "refused",
                              "failed",
                              "unknown"
                            ],
                            "description": "ok: a number was given, or the report was accepted. held: the data are correct and the Authority gave no number (codes 460, 461). decision_sent: the Authority holds the invoice and already has the decision (462). wrong_data: the Authority found a fault in what was sent. refused: the Authority refused the caller (the token, the permission). failed: a fault of the Authority. unknown: no usable answer came."
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 64,
                            "description": "A short name of why the request did not end ok."
                          },
                          "httpStatus": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The HTTP status of the answer."
                          },
                          "errorCodes": {
                            "type": "array",
                            "description": "The codes of the error list, in its order [ALC-15].",
                            "items": {
                              "type": "integer",
                              "description": "A code of the error list of the answer."
                            }
                          },
                          "said": {
                            "type": "array",
                            "description": "What the Authority said, word for word, when the request did not end well.",
                            "items": {
                              "type": "string",
                              "maxLength": 4000,
                              "description": "The words of the Authority, as received."
                            }
                          },
                          "action": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The field \"action\" of the request, when it carried one: 3 a reverse charge, 4 a tax invoice that originates in a preliminary document."
                          },
                          "originDocumentId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 36,
                            "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}$",
                            "description": "On the request of a reverse charge: the invoice that was held."
                          },
                          "batchId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 36,
                            "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}$",
                            "description": "Set when the request of this document travelled with other invoices in one request to MultiApproval: the steps of that request share it [ALC-26]."
                          },
                          "sentAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 30,
                            "format": "date-time",
                            "description": "When the request left. ISO 8601, UTC."
                          },
                          "recordedAt": {
                            "type": "string",
                            "maxLength": 30,
                            "format": "date-time",
                            "description": "When the request was recorded. ISO 8601, UTC."
                          }
                        },
                        "required": [
                          "seq",
                          "service",
                          "attempt",
                          "outcome",
                          "reason",
                          "httpStatus",
                          "errorCodes",
                          "said",
                          "action",
                          "originDocumentId",
                          "batchId",
                          "sentAt",
                          "recordedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "documentId",
                    "issuerId",
                    "docType",
                    "documentNumber",
                    "cancelled",
                    "need",
                    "status",
                    "next",
                    "allocationNumber",
                    "shortNumber",
                    "source",
                    "numberRecordedAt",
                    "invoiceId",
                    "held",
                    "decision",
                    "alternatives",
                    "hearingUrl",
                    "errors",
                    "original",
                    "numberOnCopiesOnly",
                    "warnBeforeLink",
                    "noInputTaxDeduction",
                    "leaveOutOfDetailedVatReport",
                    "faults",
                    "nextRetryAt",
                    "gaveUp",
                    "steps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{documentId}/allocation-decision": {
      "post": {
        "operationId": "reportAllocationDecision",
        "tags": [
          "Allocation"
        ],
        "summary": "Report what the business chose after the Tax Authority held its invoice",
        "description": "Only the business chooses; the client system passes the choice on [ALC-21]. It is stored first and then reported to the Authority, so a report that met a fault is not lost: state.decision.report is \"pending\", the service sends it again by itself, and the same call may be repeated. A call that answers AUTHORITY_UNREACHABLE or AUTHORITY_FAILED has stored the choice all the same: read the state. The same choice sent twice stores one row.\n\ncancel: the business abandons the invoice. Reported to Cancel. Afterwards cancel the document with the regular cancellation call, or issue a credit note when its original has left (the alternative's followUp says which). Leave the invoice and its cancellation out of the detailed VAT report [ALC-24].\n\ncontinue: the invoice is completed without a number. Reported to Continue. From then on every rendering of it says \"אין לנכות מס תשומות בגין חשבונית זו\", and the original too while it has not left [ALC-22].\n\nhearing: the business asks the Authority for a hearing, at the Authority itself (state.hearingUrl when known). Reported to FurtherObjection. If the invoice is released, ask for the number again: the request carries the same invoice_id [ALC-24].\n\nreverse_charge: the buyer agreed to take the tax upon itself. Issue, through the regular draft calls, a tax invoice (305) to the same customer (customer.key) for the same amount without VAT, every line at zero rate, with reverseChargeOf naming the invoice that was held ({\"docType\", \"number\"}). Its rendering prints the two sentences of a reverse charge from that link, word for word: \"חשבונית זו הוצאה מכוח סעיף 47(א3) לחוק מס ערך מוסף\" and \"בגין חשבונית זו לקוח חייב לדווח חשבונית עצמית\"; nobody types them. Then call this with replacementDocumentId. It is sent to the Approval service with the invoice_id of the invoice that was held and action 3; the number that comes back is stored on the zero-rate invoice [ALC-23]. Afterwards cancel the invoice that was held by the regular call.\n\nINPUT_INVALID names the reason in details.reason: \"not-held\" (the Authority did not hold this invoice), \"already-allocated\", \"already-chosen\", \"not-after-this-choice\", \"buyer-number-missing\", and for a reverse charge what is wrong with the zero-rate invoice (\"not-found\", \"another-customer\", \"not-zero-rate\", \"amount-differs\", \"not-a-reverse-charge-of-this-invoice\", \"already-allocated\", \"cancelled\").",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "The invoice the Authority held.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The choice of the business.",
                "properties": {
                  "alternative": {
                    "type": "string",
                    "maxLength": 20,
                    "enum": [
                      "cancel",
                      "continue",
                      "reverse_charge",
                      "hearing"
                    ],
                    "description": "What the business chose."
                  },
                  "replacementDocumentId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 36,
                    "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}$",
                    "description": "For reverse_charge: the zero-rate invoice."
                  }
                },
                "required": [
                  "alternative"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The choice is stored; reported says whether the Authority has accepted its report.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reported": {
                      "type": "boolean",
                      "description": "True when the Authority accepted the report of the choice."
                    },
                    "repeated": {
                      "type": "boolean",
                      "description": "True when this very choice was already stored and nothing was written again."
                    },
                    "state": {
                      "type": "object",
                      "description": "Where the allocation number of one document stands. Read from what was recorded; reading it asks the Authority nothing.",
                      "properties": {
                        "documentId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The document."
                        },
                        "issuerId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The business."
                        },
                        "docType": {
                          "type": "integer",
                          "description": "The type of the document."
                        },
                        "documentNumber": {
                          "type": "string",
                          "maxLength": 20,
                          "description": "The number of the document."
                        },
                        "cancelled": {
                          "type": "boolean",
                          "description": "True when the document is cancelled."
                        },
                        "need": {
                          "type": "object",
                          "description": "Whether the law requires an allocation number for this document. A number may be asked for any taxed tax invoice, required or not.",
                          "properties": {
                            "required": {
                              "type": "boolean",
                              "description": "True when all three hold: the amount without VAT is above the amount in force on the document date, a transaction of the document is taxed at a rate above zero, and the buyer demanded a number [ALC-01]."
                            },
                            "aboveThreshold": {
                              "type": "boolean",
                              "description": "The amount without VAT is above the amount in force on the document date [ALC-02]."
                            },
                            "threshold": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 20,
                              "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                              "description": "The amount in force on the document date. Decimal text with exactly two decimals, never a JSON number."
                            },
                            "taxed": {
                              "type": "boolean",
                              "description": "A transaction of the document is taxed at a rate above zero. A document without one is never asked about [ALC-03]."
                            },
                            "buyerDemanded": {
                              "type": "boolean",
                              "description": "The buyer demanded a number, as recorded on the document."
                            }
                          },
                          "required": [
                            "required",
                            "aboveThreshold",
                            "threshold",
                            "taxed",
                            "buyerDemanded"
                          ],
                          "additionalProperties": false
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "not-applicable",
                            "not-asked",
                            "allocated",
                            "held",
                            "decided",
                            "wrong-data",
                            "refused",
                            "pending"
                          ],
                          "description": "not-applicable: the document never takes a number through this service (a receipt, a credit note, a transaction invoice of an exempt dealer or one that corrects another). not-asked: never asked about; a transaction invoice of a licensed dealer stays here until the business asks for its approval as a preliminary document [ALC-25]. allocated: it has its number. held: the Authority held the invoice and the business has not chosen. decided: the business chose; decision says what. wrong-data: the Authority found a fault in the data of the request; errors says which. refused: the Authority refused the caller. pending: the last request met a fault or got no answer, and is asked again."
                        },
                        "next": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "none",
                            "ask",
                            "choose",
                            "retry",
                            "sign-in",
                            "ask-again",
                            "report-decision"
                          ],
                          "description": "What to do next. none. ask: ask for a number. choose: show the business the alternatives and report its choice. retry: the service asks again by itself; asking now is safe. sign-in: the owner of the business signs in at the Authority, in the portal. ask-again: after a hearing that released the invoice, ask again. report-decision: the choice was stored and its report did not arrive; send the same choice again."
                        },
                        "allocationNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 40,
                          "description": "The whole allocation number."
                        },
                        "shortNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 9,
                          "description": "Its nine rightmost digits: the ones a detailed VAT report states [ALC-09]."
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10,
                          "enum": [
                            "manual",
                            "service",
                            null
                          ],
                          "description": "manual: the business typed the number in. service: this service obtained it."
                        },
                        "numberRecordedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the number was recorded. ISO 8601, UTC."
                        },
                        "invoiceId": {
                          "type": "string",
                          "maxLength": 50,
                          "description": "The invoice_id every request of this document carries [ALC-11]."
                        },
                        "held": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "code": {
                              "type": "integer",
                              "description": "460 or 461, as the Authority answered."
                            },
                            "at": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the Authority held the invoice. ISO 8601, UTC."
                            }
                          },
                          "required": [
                            "code",
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        "decision": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "alternative": {
                              "type": "string",
                              "maxLength": 20,
                              "enum": [
                                "cancel",
                                "continue",
                                "reverse_charge",
                                "hearing"
                              ],
                              "description": "What the business chose."
                            },
                            "chosenAt": {
                              "type": "string",
                              "maxLength": 30,
                              "format": "date-time",
                              "description": "When the choice was stored. ISO 8601, UTC."
                            },
                            "report": {
                              "type": "string",
                              "maxLength": 10,
                              "enum": [
                                "reported",
                                "pending",
                                "refused"
                              ],
                              "description": "reported: the Authority accepted the report. pending: the report did not arrive yet and is sent again. refused: the Authority refused the report; steps holds its words."
                            },
                            "replacementDocumentId": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 36,
                              "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}$",
                              "description": "On a reverse charge: the zero-rate invoice that replaced this one."
                            }
                          },
                          "required": [
                            "alternative",
                            "chosenAt",
                            "report",
                            "replacementDocumentId"
                          ],
                          "additionalProperties": false
                        },
                        "alternatives": {
                          "type": "array",
                          "description": "The four alternatives after the Authority held the invoice [ALC-21]; empty unless one may be chosen now. Show all four to the business.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "alternative": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "cancel",
                                  "continue",
                                  "reverse_charge",
                                  "hearing"
                                ],
                                "description": "The alternative."
                              },
                              "order": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 4,
                                "description": "Its place among the four, as the Authority lists them."
                              },
                              "reportedTo": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "Cancel",
                                  "Continue",
                                  "Approval",
                                  "FurtherObjection"
                                ],
                                "description": "Where the choice is reported."
                              },
                              "available": {
                                "type": "boolean",
                                "description": "False when it cannot be chosen now."
                              },
                              "unavailableReason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "enum": [
                                  "buyer-number-missing",
                                  "already-chosen",
                                  "not-after-this-choice",
                                  "not-for-preliminary",
                                  null
                                ],
                                "description": "Why not. not-for-preliminary: a reverse charge is no alternative for the approval of a preliminary document [ALC-25]."
                              },
                              "followUp": {
                                "type": "string",
                                "maxLength": 30,
                                "enum": [
                                  "cancel-document",
                                  "credit-note",
                                  "correcting-invoice",
                                  "issue-zero-rate-invoice",
                                  "ask-for-hearing",
                                  "none"
                                ],
                                "description": "What the business does itself afterwards, by the regular calls of this API: cancel-document, credit-note (a tax invoice whose original has left), correcting-invoice (a transaction invoice whose original has left), issue-zero-rate-invoice, ask-for-hearing (at the Authority), or none."
                              }
                            },
                            "required": [
                              "alternative",
                              "order",
                              "reportedTo",
                              "available",
                              "unavailableReason",
                              "followUp"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "hearingUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 2048,
                          "description": "Where a hearing is asked for at the Authority, when the deployment knows the address [ALC-24]."
                        },
                        "errors": {
                          "type": "array",
                          "description": "The error list of the latest answer that carried one, as received [ALC-15].",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The code."
                              },
                              "message": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 4000,
                                "description": "The message, word for word."
                              },
                              "param": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 200,
                                "description": "The field it names."
                              },
                              "location": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 200,
                                "description": "The location it names."
                              }
                            },
                            "required": [
                              "code",
                              "message",
                              "param",
                              "location"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "original": {
                          "type": "object",
                          "properties": {
                            "released": {
                              "type": "boolean",
                              "description": "The original of the document has left the business."
                            },
                            "carriesNumber": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "True when the stored original shows the number. False when the number arrived after the original left. Null while there is no number."
                            }
                          },
                          "required": [
                            "released",
                            "carriesNumber"
                          ],
                          "additionalProperties": false
                        },
                        "numberOnCopiesOnly": {
                          "type": "boolean",
                          "description": "The number arrived after the original left: it is on copies only, and may be written on the original by hand."
                        },
                        "warnBeforeLink": {
                          "type": "boolean",
                          "description": "The law requires a number, the document has none, and its original has not left: warn the business before a link is sent, because the original that leaves will carry no number."
                        },
                        "noInputTaxDeduction": {
                          "type": "boolean",
                          "description": "Every rendering of the invoice says that input tax may not be deducted on it [ALC-22]."
                        },
                        "leaveOutOfDetailedVatReport": {
                          "type": "boolean",
                          "description": "True for an invoice the business abandoned after the Authority held it: the Authority instructs that neither the invoice nor its cancellation enters the detailed VAT report [ALC-24]."
                        },
                        "faults": {
                          "type": "integer",
                          "description": "Requests in a row that met a fault."
                        },
                        "nextRetryAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "When the service asks again by itself. ISO 8601, UTC."
                        },
                        "gaveUp": {
                          "type": "boolean",
                          "description": "The service stopped asking by itself after too many faults: ask again with the POST of this document."
                        },
                        "steps": {
                          "type": "array",
                          "description": "Every recorded request and its answer, in order.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "seq": {
                                "type": "integer",
                                "description": "The order of the recorded requests."
                              },
                              "service": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "approval",
                                  "cancel",
                                  "continue",
                                  "further_objection"
                                ],
                                "description": "approval: the request for a number. cancel, continue, further_objection: the report of a choice."
                              },
                              "attempt": {
                                "type": "integer",
                                "description": "The number of this request among the requests of the same service for the document."
                              },
                              "outcome": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "ok",
                                  "held",
                                  "decision_sent",
                                  "wrong_data",
                                  "refused",
                                  "failed",
                                  "unknown"
                                ],
                                "description": "ok: a number was given, or the report was accepted. held: the data are correct and the Authority gave no number (codes 460, 461). decision_sent: the Authority holds the invoice and already has the decision (462). wrong_data: the Authority found a fault in what was sent. refused: the Authority refused the caller (the token, the permission). failed: a fault of the Authority. unknown: no usable answer came."
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 64,
                                "description": "A short name of why the request did not end ok."
                              },
                              "httpStatus": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The HTTP status of the answer."
                              },
                              "errorCodes": {
                                "type": "array",
                                "description": "The codes of the error list, in its order [ALC-15].",
                                "items": {
                                  "type": "integer",
                                  "description": "A code of the error list of the answer."
                                }
                              },
                              "said": {
                                "type": "array",
                                "description": "What the Authority said, word for word, when the request did not end well.",
                                "items": {
                                  "type": "string",
                                  "maxLength": 4000,
                                  "description": "The words of the Authority, as received."
                                }
                              },
                              "action": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The field \"action\" of the request, when it carried one: 3 a reverse charge, 4 a tax invoice that originates in a preliminary document."
                              },
                              "originDocumentId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 36,
                                "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}$",
                                "description": "On the request of a reverse charge: the invoice that was held."
                              },
                              "batchId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 36,
                                "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}$",
                                "description": "Set when the request of this document travelled with other invoices in one request to MultiApproval: the steps of that request share it [ALC-26]."
                              },
                              "sentAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request left. ISO 8601, UTC."
                              },
                              "recordedAt": {
                                "type": "string",
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the request was recorded. ISO 8601, UTC."
                              }
                            },
                            "required": [
                              "seq",
                              "service",
                              "attempt",
                              "outcome",
                              "reason",
                              "httpStatus",
                              "errorCodes",
                              "said",
                              "action",
                              "originDocumentId",
                              "batchId",
                              "sentAt",
                              "recordedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "documentId",
                        "issuerId",
                        "docType",
                        "documentNumber",
                        "cancelled",
                        "need",
                        "status",
                        "next",
                        "allocationNumber",
                        "shortNumber",
                        "source",
                        "numberRecordedAt",
                        "invoiceId",
                        "held",
                        "decision",
                        "alternatives",
                        "hearingUrl",
                        "errors",
                        "original",
                        "numberOnCopiesOnly",
                        "warnBeforeLink",
                        "noInputTaxDeduction",
                        "leaveOutOfDetailedVatReport",
                        "faults",
                        "nextRetryAt",
                        "gaveUp",
                        "steps"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "reported",
                    "repeated",
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "DATABASE_REFUSED: The database refused the request. Nothing was issued, stored or handed out.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nRENDER_FAILED: The document file could not be produced. Nothing was issued, stored or handed out. details.reason says why, in one fixed word: \"render-timeout\" and \"browser-unavailable\" can pass by themselves, and the same request may then be sent again.\n\nSIGNATURE_NOT_VERIFIED: The signature of the document file did not verify. Nothing was issued, stored or handed out.\n\nSIGNING_FAILED: The document file could not be signed. Nothing was issued, stored or handed out.\n\nSIGNING_KEY_UNAVAILABLE: The business has no usable signing key. Nothing was issued, stored or handed out.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ALLOCATE_TIMEOUT: The time limit passed. What the choice depended on was not stored and nothing was reported; the same request can be sent again.\n\nAUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "OUTCOME_UNKNOWN: It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/allocation-requests": {
      "post": {
        "operationId": "requestAllocationNumbers",
        "tags": [
          "Allocation"
        ],
        "summary": "Ask the Tax Authority for the allocation numbers of several invoices in one request",
        "description": "Up to 100 issued documents of the business in one request to the MultiApproval service of the Authority (edition 2.0, 2.5 to 2.7) [ALC-26]: tax invoices, and transaction invoices asked about as preliminary documents. Each document is checked as the call for one document checks it, and one that cannot travel is answered for in its item without stopping the others (a document that has its number answers sent false with no error). Every document that travelled is recorded as if it had been asked about alone, and what the answer says of it is acted on in the same way: a number is stored, with the further original; a holding offers the four alternatives in its state; wrong data is the error AUTHORITY_REFUSED of its item. An invoice the answer refuses for its data is corrected and asked about again by itself, with the call for one document, as the Authority instructs; one the answer leaves out, and every invoice of a request that met a fault, is asked about again by itself by the service, with the same invoice_id.\n\nThe whole request is refused, with nothing sent, for an empty list, more than 100 documents or a document named twice (INPUT_INVALID), and for the switches and the address of the service (PRODUCTION_SWITCHED_OFF, AUTHORITY_NOT_CONFIGURED: the deployment may hold the address of the request for one invoice and not this one) and a business that holds no usable connection (SIGN_IN_REQUIRED).",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "issue"
            ]
          }
        ],
        "x-required-scope": "issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The documents to ask about.",
                "properties": {
                  "documentIds": {
                    "type": "array",
                    "maxItems": 100,
                    "description": "The documents, each once.",
                    "items": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "An issued document of the business."
                    }
                  }
                },
                "required": [
                  "documentIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request ran to its end; each item says what became of its document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 36,
                      "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}$",
                      "description": "The identifier the recorded steps of this request share; null when nothing was sent."
                    },
                    "transactionId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 100,
                      "description": "transaction_id of the answer of the Authority, as received."
                    },
                    "items": {
                      "type": "array",
                      "description": "One item per document, in the order of the request.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "documentId": {
                            "type": "string",
                            "maxLength": 36,
                            "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}$",
                            "description": "The document."
                          },
                          "sent": {
                            "type": "boolean",
                            "description": "True when its entry travelled in the request."
                          },
                          "original": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 10,
                            "enum": [
                              "stored",
                              "released",
                              "deferred",
                              null
                            ],
                            "description": "What became of the original when a number arrived, as for one document."
                          },
                          "state": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Where the allocation number of one document stands. Read from what was recorded; reading it asks the Authority nothing.",
                            "properties": {
                              "documentId": {
                                "type": "string",
                                "maxLength": 36,
                                "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}$",
                                "description": "The document."
                              },
                              "issuerId": {
                                "type": "string",
                                "maxLength": 36,
                                "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}$",
                                "description": "The business."
                              },
                              "docType": {
                                "type": "integer",
                                "description": "The type of the document."
                              },
                              "documentNumber": {
                                "type": "string",
                                "maxLength": 20,
                                "description": "The number of the document."
                              },
                              "cancelled": {
                                "type": "boolean",
                                "description": "True when the document is cancelled."
                              },
                              "need": {
                                "type": "object",
                                "description": "Whether the law requires an allocation number for this document. A number may be asked for any taxed tax invoice, required or not.",
                                "properties": {
                                  "required": {
                                    "type": "boolean",
                                    "description": "True when all three hold: the amount without VAT is above the amount in force on the document date, a transaction of the document is taxed at a rate above zero, and the buyer demanded a number [ALC-01]."
                                  },
                                  "aboveThreshold": {
                                    "type": "boolean",
                                    "description": "The amount without VAT is above the amount in force on the document date [ALC-02]."
                                  },
                                  "threshold": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "maxLength": 20,
                                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                                    "description": "The amount in force on the document date. Decimal text with exactly two decimals, never a JSON number."
                                  },
                                  "taxed": {
                                    "type": "boolean",
                                    "description": "A transaction of the document is taxed at a rate above zero. A document without one is never asked about [ALC-03]."
                                  },
                                  "buyerDemanded": {
                                    "type": "boolean",
                                    "description": "The buyer demanded a number, as recorded on the document."
                                  }
                                },
                                "required": [
                                  "required",
                                  "aboveThreshold",
                                  "threshold",
                                  "taxed",
                                  "buyerDemanded"
                                ],
                                "additionalProperties": false
                              },
                              "status": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "not-applicable",
                                  "not-asked",
                                  "allocated",
                                  "held",
                                  "decided",
                                  "wrong-data",
                                  "refused",
                                  "pending"
                                ],
                                "description": "not-applicable: the document never takes a number through this service (a receipt, a credit note, a transaction invoice of an exempt dealer or one that corrects another). not-asked: never asked about; a transaction invoice of a licensed dealer stays here until the business asks for its approval as a preliminary document [ALC-25]. allocated: it has its number. held: the Authority held the invoice and the business has not chosen. decided: the business chose; decision says what. wrong-data: the Authority found a fault in the data of the request; errors says which. refused: the Authority refused the caller. pending: the last request met a fault or got no answer, and is asked again."
                              },
                              "next": {
                                "type": "string",
                                "maxLength": 20,
                                "enum": [
                                  "none",
                                  "ask",
                                  "choose",
                                  "retry",
                                  "sign-in",
                                  "ask-again",
                                  "report-decision"
                                ],
                                "description": "What to do next. none. ask: ask for a number. choose: show the business the alternatives and report its choice. retry: the service asks again by itself; asking now is safe. sign-in: the owner of the business signs in at the Authority, in the portal. ask-again: after a hearing that released the invoice, ask again. report-decision: the choice was stored and its report did not arrive; send the same choice again."
                              },
                              "allocationNumber": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 40,
                                "description": "The whole allocation number."
                              },
                              "shortNumber": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 9,
                                "description": "Its nine rightmost digits: the ones a detailed VAT report states [ALC-09]."
                              },
                              "source": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 10,
                                "enum": [
                                  "manual",
                                  "service",
                                  null
                                ],
                                "description": "manual: the business typed the number in. service: this service obtained it."
                              },
                              "numberRecordedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the number was recorded. ISO 8601, UTC."
                              },
                              "invoiceId": {
                                "type": "string",
                                "maxLength": 50,
                                "description": "The invoice_id every request of this document carries [ALC-11]."
                              },
                              "held": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "code": {
                                    "type": "integer",
                                    "description": "460 or 461, as the Authority answered."
                                  },
                                  "at": {
                                    "type": "string",
                                    "maxLength": 30,
                                    "format": "date-time",
                                    "description": "When the Authority held the invoice. ISO 8601, UTC."
                                  }
                                },
                                "required": [
                                  "code",
                                  "at"
                                ],
                                "additionalProperties": false
                              },
                              "decision": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "alternative": {
                                    "type": "string",
                                    "maxLength": 20,
                                    "enum": [
                                      "cancel",
                                      "continue",
                                      "reverse_charge",
                                      "hearing"
                                    ],
                                    "description": "What the business chose."
                                  },
                                  "chosenAt": {
                                    "type": "string",
                                    "maxLength": 30,
                                    "format": "date-time",
                                    "description": "When the choice was stored. ISO 8601, UTC."
                                  },
                                  "report": {
                                    "type": "string",
                                    "maxLength": 10,
                                    "enum": [
                                      "reported",
                                      "pending",
                                      "refused"
                                    ],
                                    "description": "reported: the Authority accepted the report. pending: the report did not arrive yet and is sent again. refused: the Authority refused the report; steps holds its words."
                                  },
                                  "replacementDocumentId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "maxLength": 36,
                                    "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}$",
                                    "description": "On a reverse charge: the zero-rate invoice that replaced this one."
                                  }
                                },
                                "required": [
                                  "alternative",
                                  "chosenAt",
                                  "report",
                                  "replacementDocumentId"
                                ],
                                "additionalProperties": false
                              },
                              "alternatives": {
                                "type": "array",
                                "description": "The four alternatives after the Authority held the invoice [ALC-21]; empty unless one may be chosen now. Show all four to the business.",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "alternative": {
                                      "type": "string",
                                      "maxLength": 20,
                                      "enum": [
                                        "cancel",
                                        "continue",
                                        "reverse_charge",
                                        "hearing"
                                      ],
                                      "description": "The alternative."
                                    },
                                    "order": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 4,
                                      "description": "Its place among the four, as the Authority lists them."
                                    },
                                    "reportedTo": {
                                      "type": "string",
                                      "maxLength": 20,
                                      "enum": [
                                        "Cancel",
                                        "Continue",
                                        "Approval",
                                        "FurtherObjection"
                                      ],
                                      "description": "Where the choice is reported."
                                    },
                                    "available": {
                                      "type": "boolean",
                                      "description": "False when it cannot be chosen now."
                                    },
                                    "unavailableReason": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 30,
                                      "enum": [
                                        "buyer-number-missing",
                                        "already-chosen",
                                        "not-after-this-choice",
                                        "not-for-preliminary",
                                        null
                                      ],
                                      "description": "Why not. not-for-preliminary: a reverse charge is no alternative for the approval of a preliminary document [ALC-25]."
                                    },
                                    "followUp": {
                                      "type": "string",
                                      "maxLength": 30,
                                      "enum": [
                                        "cancel-document",
                                        "credit-note",
                                        "correcting-invoice",
                                        "issue-zero-rate-invoice",
                                        "ask-for-hearing",
                                        "none"
                                      ],
                                      "description": "What the business does itself afterwards, by the regular calls of this API: cancel-document, credit-note (a tax invoice whose original has left), correcting-invoice (a transaction invoice whose original has left), issue-zero-rate-invoice, ask-for-hearing (at the Authority), or none."
                                    }
                                  },
                                  "required": [
                                    "alternative",
                                    "order",
                                    "reportedTo",
                                    "available",
                                    "unavailableReason",
                                    "followUp"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "hearingUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 2048,
                                "description": "Where a hearing is asked for at the Authority, when the deployment knows the address [ALC-24]."
                              },
                              "errors": {
                                "type": "array",
                                "description": "The error list of the latest answer that carried one, as received [ALC-15].",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": [
                                        "integer",
                                        "null"
                                      ],
                                      "description": "The code."
                                    },
                                    "message": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 4000,
                                      "description": "The message, word for word."
                                    },
                                    "param": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 200,
                                      "description": "The field it names."
                                    },
                                    "location": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 200,
                                      "description": "The location it names."
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "param",
                                    "location"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "original": {
                                "type": "object",
                                "properties": {
                                  "released": {
                                    "type": "boolean",
                                    "description": "The original of the document has left the business."
                                  },
                                  "carriesNumber": {
                                    "type": [
                                      "boolean",
                                      "null"
                                    ],
                                    "description": "True when the stored original shows the number. False when the number arrived after the original left. Null while there is no number."
                                  }
                                },
                                "required": [
                                  "released",
                                  "carriesNumber"
                                ],
                                "additionalProperties": false
                              },
                              "numberOnCopiesOnly": {
                                "type": "boolean",
                                "description": "The number arrived after the original left: it is on copies only, and may be written on the original by hand."
                              },
                              "warnBeforeLink": {
                                "type": "boolean",
                                "description": "The law requires a number, the document has none, and its original has not left: warn the business before a link is sent, because the original that leaves will carry no number."
                              },
                              "noInputTaxDeduction": {
                                "type": "boolean",
                                "description": "Every rendering of the invoice says that input tax may not be deducted on it [ALC-22]."
                              },
                              "leaveOutOfDetailedVatReport": {
                                "type": "boolean",
                                "description": "True for an invoice the business abandoned after the Authority held it: the Authority instructs that neither the invoice nor its cancellation enters the detailed VAT report [ALC-24]."
                              },
                              "faults": {
                                "type": "integer",
                                "description": "Requests in a row that met a fault."
                              },
                              "nextRetryAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "format": "date-time",
                                "description": "When the service asks again by itself. ISO 8601, UTC."
                              },
                              "gaveUp": {
                                "type": "boolean",
                                "description": "The service stopped asking by itself after too many faults: ask again with the POST of this document."
                              },
                              "steps": {
                                "type": "array",
                                "description": "Every recorded request and its answer, in order.",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "seq": {
                                      "type": "integer",
                                      "description": "The order of the recorded requests."
                                    },
                                    "service": {
                                      "type": "string",
                                      "maxLength": 20,
                                      "enum": [
                                        "approval",
                                        "cancel",
                                        "continue",
                                        "further_objection"
                                      ],
                                      "description": "approval: the request for a number. cancel, continue, further_objection: the report of a choice."
                                    },
                                    "attempt": {
                                      "type": "integer",
                                      "description": "The number of this request among the requests of the same service for the document."
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "maxLength": 20,
                                      "enum": [
                                        "ok",
                                        "held",
                                        "decision_sent",
                                        "wrong_data",
                                        "refused",
                                        "failed",
                                        "unknown"
                                      ],
                                      "description": "ok: a number was given, or the report was accepted. held: the data are correct and the Authority gave no number (codes 460, 461). decision_sent: the Authority holds the invoice and already has the decision (462). wrong_data: the Authority found a fault in what was sent. refused: the Authority refused the caller (the token, the permission). failed: a fault of the Authority. unknown: no usable answer came."
                                    },
                                    "reason": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 64,
                                      "description": "A short name of why the request did not end ok."
                                    },
                                    "httpStatus": {
                                      "type": [
                                        "integer",
                                        "null"
                                      ],
                                      "description": "The HTTP status of the answer."
                                    },
                                    "errorCodes": {
                                      "type": "array",
                                      "description": "The codes of the error list, in its order [ALC-15].",
                                      "items": {
                                        "type": "integer",
                                        "description": "A code of the error list of the answer."
                                      }
                                    },
                                    "said": {
                                      "type": "array",
                                      "description": "What the Authority said, word for word, when the request did not end well.",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 4000,
                                        "description": "The words of the Authority, as received."
                                      }
                                    },
                                    "action": {
                                      "type": [
                                        "integer",
                                        "null"
                                      ],
                                      "description": "The field \"action\" of the request, when it carried one: 3 a reverse charge, 4 a tax invoice that originates in a preliminary document."
                                    },
                                    "originDocumentId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 36,
                                      "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}$",
                                      "description": "On the request of a reverse charge: the invoice that was held."
                                    },
                                    "batchId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 36,
                                      "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}$",
                                      "description": "Set when the request of this document travelled with other invoices in one request to MultiApproval: the steps of that request share it [ALC-26]."
                                    },
                                    "sentAt": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "maxLength": 30,
                                      "format": "date-time",
                                      "description": "When the request left. ISO 8601, UTC."
                                    },
                                    "recordedAt": {
                                      "type": "string",
                                      "maxLength": 30,
                                      "format": "date-time",
                                      "description": "When the request was recorded. ISO 8601, UTC."
                                    }
                                  },
                                  "required": [
                                    "seq",
                                    "service",
                                    "attempt",
                                    "outcome",
                                    "reason",
                                    "httpStatus",
                                    "errorCodes",
                                    "said",
                                    "action",
                                    "originDocumentId",
                                    "batchId",
                                    "sentAt",
                                    "recordedAt"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "documentId",
                              "issuerId",
                              "docType",
                              "documentNumber",
                              "cancelled",
                              "need",
                              "status",
                              "next",
                              "allocationNumber",
                              "shortNumber",
                              "source",
                              "numberRecordedAt",
                              "invoiceId",
                              "held",
                              "decision",
                              "alternatives",
                              "hearingUrl",
                              "errors",
                              "original",
                              "numberOnCopiesOnly",
                              "warnBeforeLink",
                              "noInputTaxDeduction",
                              "leaveOutOfDetailedVatReport",
                              "faults",
                              "nextRetryAt",
                              "gaveUp",
                              "steps"
                            ],
                            "additionalProperties": false
                          },
                          "error": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "code": {
                                "type": "string",
                                "maxLength": 40,
                                "description": "The error code, as the call for one document would answer it."
                              },
                              "message": {
                                "type": "string",
                                "maxLength": 500,
                                "description": "For logs and operators, in English."
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "maxLength": 4000,
                                  "description": "What the Authority said, word for word."
                                }
                              },
                              "details": {
                                "type": "object",
                                "description": "As the call for one document would carry them: details.reason, details.kind, details.codes.",
                                "additionalProperties": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "code",
                              "message",
                              "reasons",
                              "details"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "documentId",
                          "sent",
                          "original",
                          "state",
                          "error"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "batchId",
                    "transactionId",
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/allocation-minimum-amount": {
      "get": {
        "operationId": "readAllocationMinimumAmount",
        "tags": [
          "Allocation"
        ],
        "summary": "The amount above which a tax invoice needs an allocation number, as the Tax Authority states it",
        "description": "Asks the MinimumAmount service of the Authority (addendum 8.2025 to edition 2.0) for a date, with the connection of the business, and sets its answer beside the amount this product holds for that date [ALC-17, ALC-02]. The service answers a VAT amount (\"סכום המע\"מ המינימלי המחייב הקצאת חשבונית\"; its example, 3600 in 2025, is 18% of the 20,000 of that year): impliedThreshold is that VAT turned into the amount without VAT by the rate in force on the date. The product's own table, which rests on the law, stays the one that decides whether a number is required; agrees false says that the two differ, for the operator to look at. Nothing is stored in the table by this call.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business whose connection asks.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "The date of the invoice, \"YYYY-MM-DD\". Left out: today in Israel. \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "What the Authority said, and the product's own amount for the date.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "maxLength": 10,
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                      "description": "The date asked about. \"YYYY-MM-DD\"."
                    },
                    "minimumVat": {
                      "type": "string",
                      "maxLength": 20,
                      "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                      "description": "minimum_amount as the Authority answered it: a VAT amount. Decimal text with exactly two decimals, never a JSON number."
                    },
                    "vatRate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 6,
                      "description": "The VAT rate in force on the date, percent."
                    },
                    "impliedThreshold": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 20,
                      "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                      "description": "The amount without VAT that the VAT stands for at that rate. Decimal text with exactly two decimals, never a JSON number."
                    },
                    "exact": {
                      "type": "boolean",
                      "description": "False when the VAT does not divide into whole agorot at the rate, so impliedThreshold is rounded."
                    },
                    "tableThreshold": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 20,
                      "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                      "description": "The amount in force on the date in the table of this product [ALC-02]. Decimal text with exactly two decimals, never a JSON number."
                    },
                    "agrees": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "True when the two agree, false when they differ, null when either is missing."
                    }
                  },
                  "required": [
                    "date",
                    "minimumVat",
                    "vatRate",
                    "impliedThreshold",
                    "exact",
                    "tableThreshold",
                    "agrees"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/received-invoices/details": {
      "post": {
        "operationId": "lookupReceivedInvoice",
        "tags": [
          "Allocation"
        ],
        "summary": "The details of a received invoice, by the allocation number printed on it",
        "description": "For a business that received a tax invoice: asks invoice-information/details of the Authority (version 2, addendum 6.2026) with the connection of the business, which asks as the buyer [ALC-20]. The allocation number may be the whole one or its nine rightmost digits. found false: the Authority holds no invoice with this number from this supplier to this business (code 472). Nothing is stored beside an audit row.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business that received the invoice.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "supplierVatNumber": {
                    "type": "string",
                    "maxLength": 11,
                    "description": "The dealer number of the business that issued the invoice, nine digits."
                  },
                  "confirmationNumber": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "The allocation number printed on it: the whole one or its nine rightmost digits."
                  }
                },
                "required": [
                  "supplierVatNumber",
                  "confirmationNumber"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the Authority holds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean",
                      "description": "False when the Authority holds no such invoice."
                    },
                    "invoice": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "An invoice this business received, as the Authority holds it (table 1.2.2 of the addendum of 6.2026).",
                      "properties": {
                        "invoiceType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 4,
                          "description": "The type of the document (table 2.5): 305, 320, 330 ..."
                        },
                        "vatNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 9,
                          "description": "The dealer number of the business that issued it."
                        },
                        "unionVatNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 9,
                          "description": "The number it reports under in a union of dealers."
                        },
                        "invoiceReferenceNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 20,
                          "description": "Its number."
                        },
                        "customerVatNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 9,
                          "description": "The buyer, this business."
                        },
                        "customerName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 25,
                          "description": "The buyer's name as reported."
                        },
                        "invoiceDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10,
                          "description": "The date printed on it."
                        },
                        "invoiceIssuanceDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10,
                          "description": "The day it was produced."
                        },
                        "amountBeforeDiscount": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 24,
                          "description": "The amount before the discount of the document. As the Authority wrote it: decimal text, never rounded."
                        },
                        "discount": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 24,
                          "description": "The discount of the document. As the Authority wrote it: decimal text, never rounded."
                        },
                        "paymentAmount": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 24,
                          "description": "The amount without VAT. As the Authority wrote it: decimal text, never rounded."
                        },
                        "vatAmount": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 24,
                          "description": "The VAT. As the Authority wrote it: decimal text, never rounded."
                        },
                        "paymentAmountIncludingVat": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 24,
                          "description": "The total including VAT. As the Authority wrote it: decimal text, never rounded."
                        },
                        "invoiceNote": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 100,
                          "description": "A remark."
                        },
                        "confirmationNumber": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 50,
                          "description": "The whole allocation number."
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "index": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 6,
                                "description": "The line number."
                              },
                              "catalogId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 13,
                                "description": "The item code."
                              },
                              "category": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 6,
                                "description": "The category of the item."
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 30,
                                "description": "The description."
                              },
                              "measureUnit": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 20,
                                "description": "The unit."
                              },
                              "quantity": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The quantity. As the Authority wrote it: decimal text, never rounded."
                              },
                              "pricePerUnit": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The price of one unit. As the Authority wrote it: decimal text, never rounded."
                              },
                              "discount": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The discount of the line. As the Authority wrote it: decimal text, never rounded."
                              },
                              "totalAmount": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The line without VAT. As the Authority wrote it: decimal text, never rounded."
                              },
                              "vatRate": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The VAT rate. As the Authority wrote it: decimal text, never rounded."
                              },
                              "vatAmount": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 24,
                                "description": "The VAT of the line. As the Authority wrote it: decimal text, never rounded."
                              }
                            },
                            "required": [
                              "index",
                              "catalogId",
                              "category",
                              "description",
                              "measureUnit",
                              "quantity",
                              "pricePerUnit",
                              "discount",
                              "totalAmount",
                              "vatRate",
                              "vatAmount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "invoiceType",
                        "vatNumber",
                        "unionVatNumber",
                        "invoiceReferenceNumber",
                        "customerVatNumber",
                        "customerName",
                        "invoiceDate",
                        "invoiceIssuanceDate",
                        "amountBeforeDiscount",
                        "discount",
                        "paymentAmount",
                        "vatAmount",
                        "paymentAmountIncludingVat",
                        "invoiceNote",
                        "confirmationNumber",
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "found",
                    "invoice"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/received-invoices/confirmation-number": {
      "post": {
        "operationId": "lookupReceivedConfirmationNumber",
        "tags": [
          "Allocation"
        ],
        "summary": "The allocation number of a received invoice, by its details",
        "description": "For a business that received a tax invoice without a number, or wants to check the one on it: asks invoice-information/confirmationNumber of the Authority (version 2, addendum 6.2026) with the connection of the business, as the buyer, with the amounts and the date printed on the invoice [ALC-20]. found false: the Authority holds no such invoice (code 472).",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business that received the invoice.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "supplierVatNumber": {
                    "type": "string",
                    "maxLength": 11,
                    "description": "The dealer number of the business that issued the invoice, nine digits."
                  },
                  "net": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The amount without VAT printed on it. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "vat": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The VAT printed on it. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "invoiceDate": {
                    "type": "string",
                    "maxLength": 10,
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                    "description": "The date printed on it. \"YYYY-MM-DD\"."
                  },
                  "referenceNumber": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20,
                    "minLength": 1,
                    "description": "Its number, as printed. The Authority recommends sending it always."
                  }
                },
                "required": [
                  "supplierVatNumber",
                  "net",
                  "vat",
                  "invoiceDate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the Authority holds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean",
                      "description": "False when the Authority holds no such invoice."
                    },
                    "confirmationNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 40,
                      "description": "The whole allocation number."
                    },
                    "shortNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 9,
                      "description": "Its nine rightmost digits."
                    }
                  },
                  "required": [
                    "found",
                    "confirmationNumber",
                    "shortNumber"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALLOCATION_IN_PROGRESS: Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.\n\nSIGN_IN_REQUIRED: The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "AUTHORITY_REFUSED: The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received.\n\nINPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.\n\nTOKEN_STORE_UNREADABLE: The stored tokens of the business cannot be opened. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "AUTHORITY_FAILED: The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "AUTHORITY_NOT_CONFIGURED: This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent.\n\nAUTHORITY_UNREACHABLE: No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there.\n\nPRODUCTION_SWITCHED_OFF: The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent.\n\nUNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/backups": {
      "post": {
        "operationId": "startBackup",
        "tags": [
          "Backup"
        ],
        "summary": "Start a backup of a business now",
        "description": "Makes a backup of everything the accounts system holds for the business at this moment (its documents with their signed files, its consents, its customers and the other lists, its uniform-structure files) and records its date. The files of the backup are taken by the business itself, in the portal of the product: this API never hands them out. A request sent again within a minute of a finished backup answers 200 with that backup and \"repeated\": true, so a request whose answer was lost can simply be sent again. A business makes at most three backups on request in 24 hours (BACKUP_LIMIT).",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "records"
            ]
          }
        ],
        "x-required-scope": "records",
        "responses": {
          "200": {
            "description": "A backup was made less than a minute ago; this is it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "repeated": {
                      "type": "boolean",
                      "description": "True: an earlier request made the backup."
                    },
                    "backup": {
                      "type": "object",
                      "description": "The record of one backup of the accounts system of a business.",
                      "properties": {
                        "backupId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The backup."
                        },
                        "backupNo": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Consecutive number of the backup within the business."
                        },
                        "kind": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "initiated",
                            "quarterly"
                          ],
                          "description": "\"initiated\": somebody asked for it. \"quarterly\": made by the service in the first week of a quarter."
                        },
                        "madeAt": {
                          "type": "string",
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "The date of the backup. ISO 8601, UTC."
                        },
                        "throughRecordNo": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The record number of the last document in the backup; 0 when the business issued nothing yet."
                        },
                        "documentCount": {
                          "type": "integer",
                          "description": "Documents in the backup."
                        },
                        "signedFileCount": {
                          "type": "integer",
                          "description": "Stored signed files in the backup."
                        },
                        "manifestSha256": {
                          "type": "string",
                          "maxLength": 64,
                          "description": "SHA-256 of the manifest of the backup, hex. The manifest names every file of the backup with its own hash."
                        },
                        "startedBy": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "issuer_user",
                            "client",
                            "operator",
                            "system"
                          ],
                          "description": "Who started it."
                        },
                        "downloaded": {
                          "type": "boolean",
                          "description": "True once every file of the backup was taken by a user of the business."
                        },
                        "volumes": {
                          "type": "array",
                          "description": "The files of the backup.",
                          "items": {
                            "type": "object",
                            "description": "One file of a backup. The bytes are taken in the portal only.",
                            "properties": {
                              "volumeNo": {
                                "type": "integer",
                                "minimum": 1,
                                "description": "The number of the file within the backup, from 1."
                              },
                              "fileName": {
                                "type": "string",
                                "maxLength": 110,
                                "description": "The name the file is downloaded under, in the portal."
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "description": "The size of the file."
                              },
                              "sha256": {
                                "type": "string",
                                "maxLength": 64,
                                "description": "SHA-256 of the file, hex."
                              },
                              "available": {
                                "type": "boolean",
                                "description": "False once a later backup of the business replaced this one: its record stays, its bytes do not."
                              },
                              "downloaded": {
                                "type": "boolean",
                                "description": "True once a user of the business took the file."
                              }
                            },
                            "required": [
                              "volumeNo",
                              "fileName",
                              "sizeBytes",
                              "sha256",
                              "available",
                              "downloaded"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "backupId",
                        "backupNo",
                        "kind",
                        "madeAt",
                        "throughRecordNo",
                        "documentCount",
                        "signedFileCount",
                        "manifestSha256",
                        "startedBy",
                        "downloaded",
                        "volumes"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "repeated",
                    "backup"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The backup was made and recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "repeated": {
                      "type": "boolean",
                      "description": "False: this request made the backup."
                    },
                    "backup": {
                      "type": "object",
                      "description": "The record of one backup of the accounts system of a business.",
                      "properties": {
                        "backupId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The backup."
                        },
                        "backupNo": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Consecutive number of the backup within the business."
                        },
                        "kind": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "initiated",
                            "quarterly"
                          ],
                          "description": "\"initiated\": somebody asked for it. \"quarterly\": made by the service in the first week of a quarter."
                        },
                        "madeAt": {
                          "type": "string",
                          "maxLength": 30,
                          "format": "date-time",
                          "description": "The date of the backup. ISO 8601, UTC."
                        },
                        "throughRecordNo": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The record number of the last document in the backup; 0 when the business issued nothing yet."
                        },
                        "documentCount": {
                          "type": "integer",
                          "description": "Documents in the backup."
                        },
                        "signedFileCount": {
                          "type": "integer",
                          "description": "Stored signed files in the backup."
                        },
                        "manifestSha256": {
                          "type": "string",
                          "maxLength": 64,
                          "description": "SHA-256 of the manifest of the backup, hex. The manifest names every file of the backup with its own hash."
                        },
                        "startedBy": {
                          "type": "string",
                          "maxLength": 20,
                          "enum": [
                            "issuer_user",
                            "client",
                            "operator",
                            "system"
                          ],
                          "description": "Who started it."
                        },
                        "downloaded": {
                          "type": "boolean",
                          "description": "True once every file of the backup was taken by a user of the business."
                        },
                        "volumes": {
                          "type": "array",
                          "description": "The files of the backup.",
                          "items": {
                            "type": "object",
                            "description": "One file of a backup. The bytes are taken in the portal only.",
                            "properties": {
                              "volumeNo": {
                                "type": "integer",
                                "minimum": 1,
                                "description": "The number of the file within the backup, from 1."
                              },
                              "fileName": {
                                "type": "string",
                                "maxLength": 110,
                                "description": "The name the file is downloaded under, in the portal."
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "description": "The size of the file."
                              },
                              "sha256": {
                                "type": "string",
                                "maxLength": 64,
                                "description": "SHA-256 of the file, hex."
                              },
                              "available": {
                                "type": "boolean",
                                "description": "False once a later backup of the business replaced this one: its record stays, its bytes do not."
                              },
                              "downloaded": {
                                "type": "boolean",
                                "description": "True once a user of the business took the file."
                              }
                            },
                            "required": [
                              "volumeNo",
                              "fileName",
                              "sizeBytes",
                              "sha256",
                              "available",
                              "downloaded"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "backupId",
                        "backupNo",
                        "kind",
                        "madeAt",
                        "throughRecordNo",
                        "documentCount",
                        "signedFileCount",
                        "manifestSha256",
                        "startedBy",
                        "downloaded",
                        "volumes"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "repeated",
                    "backup"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "BACKUP_IN_PROGRESS: A backup of this business is being made at this moment. List the backups in a moment.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "BACKUP_LIMIT: This business made as many backups on request in the last 24 hours as it may (details.perDay). The latest backup can still be taken in the portal, and the quarterly backup is not counted. Retry after the number of seconds in Retry-After.\n\nRATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "BACKUP_FAILED: The backup could not be made. Nothing was recorded.\n\nINTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listBackups",
        "tags": [
          "Backup"
        ],
        "summary": "The backups of a business",
        "description": "The record of every backup that was made of the business, newest first: its date, how far the permanent file reached, and whether the business took its files. At most the newest 100.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The backups.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 100,
                      "description": "Newest first.",
                      "items": {
                        "type": "object",
                        "description": "The record of one backup of the accounts system of a business.",
                        "properties": {
                          "backupId": {
                            "type": "string",
                            "maxLength": 36,
                            "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}$",
                            "description": "The backup."
                          },
                          "backupNo": {
                            "type": "integer",
                            "minimum": 1,
                            "description": "Consecutive number of the backup within the business."
                          },
                          "kind": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "initiated",
                              "quarterly"
                            ],
                            "description": "\"initiated\": somebody asked for it. \"quarterly\": made by the service in the first week of a quarter."
                          },
                          "madeAt": {
                            "type": "string",
                            "maxLength": 30,
                            "format": "date-time",
                            "description": "The date of the backup. ISO 8601, UTC."
                          },
                          "throughRecordNo": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "The record number of the last document in the backup; 0 when the business issued nothing yet."
                          },
                          "documentCount": {
                            "type": "integer",
                            "description": "Documents in the backup."
                          },
                          "signedFileCount": {
                            "type": "integer",
                            "description": "Stored signed files in the backup."
                          },
                          "manifestSha256": {
                            "type": "string",
                            "maxLength": 64,
                            "description": "SHA-256 of the manifest of the backup, hex. The manifest names every file of the backup with its own hash."
                          },
                          "startedBy": {
                            "type": "string",
                            "maxLength": 20,
                            "enum": [
                              "issuer_user",
                              "client",
                              "operator",
                              "system"
                            ],
                            "description": "Who started it."
                          },
                          "downloaded": {
                            "type": "boolean",
                            "description": "True once every file of the backup was taken by a user of the business."
                          },
                          "volumes": {
                            "type": "array",
                            "description": "The files of the backup.",
                            "items": {
                              "type": "object",
                              "description": "One file of a backup. The bytes are taken in the portal only.",
                              "properties": {
                                "volumeNo": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "description": "The number of the file within the backup, from 1."
                                },
                                "fileName": {
                                  "type": "string",
                                  "maxLength": 110,
                                  "description": "The name the file is downloaded under, in the portal."
                                },
                                "sizeBytes": {
                                  "type": "integer",
                                  "description": "The size of the file."
                                },
                                "sha256": {
                                  "type": "string",
                                  "maxLength": 64,
                                  "description": "SHA-256 of the file, hex."
                                },
                                "available": {
                                  "type": "boolean",
                                  "description": "False once a later backup of the business replaced this one: its record stays, its bytes do not."
                                },
                                "downloaded": {
                                  "type": "boolean",
                                  "description": "True once a user of the business took the file."
                                }
                              },
                              "required": [
                                "volumeNo",
                                "fileName",
                                "sizeBytes",
                                "sha256",
                                "available",
                                "downloaded"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "backupId",
                          "backupNo",
                          "kind",
                          "madeAt",
                          "throughRecordNo",
                          "documentCount",
                          "signedFileCount",
                          "manifestSha256",
                          "startedBy",
                          "downloaded",
                          "volumes"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/finance": {
      "get": {
        "operationId": "getFinanceYear",
        "tags": [
          "Finances"
        ],
        "summary": "Income, expenses and profit of a year",
        "description": "The year as the portal's screen \"כספים\" shows it: the three sums, the twelve months, the income by customer and the expenses by kind, and the years that hold anything. Income is read from the documents the business issued and nothing of them changes. Each call is written to the audit log of the business: the answer holds the names of customers and their sums.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "description": "The year, \"YYYY\", 2000 to 2099.",
            "schema": {
              "type": "string",
              "maxLength": 4,
              "pattern": "^20[0-9]{2}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "finance"
            ]
          }
        ],
        "x-required-scope": "finance",
        "responses": {
          "200": {
            "description": "The year.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinanceYear"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/expenses": {
      "get": {
        "operationId": "listExpenses",
        "tags": [
          "Finances"
        ],
        "summary": "The expenses of a business",
        "description": "Newest first, by the date of the expense. A removed expense is never listed. \"month\" needs \"year\".",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Only the expenses of this year, \"YYYY\".",
            "schema": {
              "type": "string",
              "maxLength": 4,
              "pattern": "^20[0-9]{2}$"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Only the expenses of this month of the year, \"01\" to \"12\".",
            "schema": {
              "type": "string",
              "maxLength": 2,
              "pattern": "^(0[1-9]|1[0-2])$"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only the expenses of this kind.",
            "schema": {
              "type": "string",
              "maxLength": 20,
              "enum": [
                "materials",
                "equipment",
                "office",
                "vehicle",
                "travel",
                "phone",
                "software",
                "marketing",
                "professional",
                "rent",
                "insurance",
                "fees",
                "training",
                "other"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "finance"
            ]
          }
        ],
        "x-required-scope": "finance",
        "responses": {
          "200": {
            "description": "A page of expenses.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of expenses.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Expense"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200,
                      "description": "Pass as \"cursor\" to read the next page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createExpense",
        "tags": [
          "Finances"
        ],
        "summary": "Record an expense",
        "description": "Records an expense of the business for the owner's own view of income and profit. It enters no document, series, uniform file or transmission. Each field is checked as the portal checks it; a refusal names every field at fault (EXPENSE_REFUSED) and stores nothing.\n\nIdempotency: the Idempotency-Key header is required, 1 to 255 printable ASCII characters, one per expense the caller means to record. The same key with the same body answers the expense it recorded (\"replayed\": true, 200) and records nothing; the same key with another body, or for another business, is refused (IDEMPOTENCY_KEY_REUSED); a key whose expense was removed since answers EXPENSE_REMOVED. A request that was refused stored nothing and its key is free.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chosen by the caller: one key per expense it means to record.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "expenses"
            ]
          }
        ],
        "x-required-scope": "expenses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExpenseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key was used before with this same request: the expense it recorded, as it stands now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing new was stored: the same Idempotency-Key and request were sent before, or the change changed nothing."
                    },
                    "expense": {
                      "$ref": "#/components/schemas/Expense"
                    }
                  },
                  "required": [
                    "replayed",
                    "expense"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The expense was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing new was stored: the same Idempotency-Key and request were sent before, or the change changed nothing."
                    },
                    "expense": {
                      "$ref": "#/components/schemas/Expense"
                    }
                  },
                  "required": [
                    "replayed",
                    "expense"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED: The Idempotency-Key was already used with a different request.\n\nISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "EXPENSE_REMOVED: The expense recorded under this Idempotency-Key was removed since; details.expenseId names it. Nothing was recorded. Record a new expense under a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "EXPENSE_REFUSED: The expense was not stored. details names each field that was refused with the reason in one fixed word: date-invalid, supplier-missing, supplier-long, amount-invalid, vat-invalid, vat-above-amount, category-unknown, note-long, file-kind (not a JPEG, PNG or PDF by its first bytes, or not the media type it was sent as), file-large, file-empty.\n\nIDEMPOTENCY_KEY_INVALID: The Idempotency-Key header is missing or is not 1 to 255 printable ASCII characters.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/expenses/{expenseId}": {
      "get": {
        "operationId": "getExpense",
        "tags": [
          "Finances"
        ],
        "summary": "One expense",
        "description": "An expense as it stands now. A removed expense is not found.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "description": "The expense.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "finance"
            ]
          }
        ],
        "x-required-scope": "finance",
        "responses": {
          "200": {
            "description": "The expense.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expense"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateExpense",
        "tags": [
          "Finances"
        ],
        "summary": "Correct an expense",
        "description": "Changes the fields sent and keeps the others; \"note\": null removes the note. The whole expense, as it would stand, is checked again. Sent twice, the same change is the same expense: the second answers \"replayed\": true and changes nothing. A removed expense is not found.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "description": "The expense.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "expenses"
            ]
          }
        ],
        "x-required-scope": "expenses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExpenseChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The expense as it stands now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing new was stored: the same Idempotency-Key and request were sent before, or the change changed nothing."
                    },
                    "expense": {
                      "$ref": "#/components/schemas/Expense"
                    }
                  },
                  "required": [
                    "replayed",
                    "expense"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "EXPENSE_REFUSED: The expense was not stored. details names each field that was refused with the reason in one fixed word: date-invalid, supplier-missing, supplier-long, amount-invalid, vat-invalid, vat-above-amount, category-unknown, note-long, file-kind (not a JPEG, PNG or PDF by its first bytes, or not the media type it was sent as), file-large, file-empty.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removeExpense",
        "tags": [
          "Finances"
        ],
        "summary": "Remove an expense",
        "description": "The expense is shown nowhere and counted in no total from now on. Its row is kept, with the moment and the client system that removed it, and nothing deletes it; a removal is final. Sent again, the answer is the same removal (\"replayed\": true) and nothing changes.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "description": "The expense.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "expenses"
            ]
          }
        ],
        "x-required-scope": "expenses",
        "responses": {
          "200": {
            "description": "The expense is removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The expense."
                    },
                    "removed": {
                      "type": "boolean",
                      "description": "Always true."
                    },
                    "removedAt": {
                      "type": "string",
                      "maxLength": 30,
                      "format": "date-time",
                      "description": "When it was removed. ISO 8601, UTC."
                    },
                    "replayed": {
                      "type": "boolean",
                      "description": "True when it had been removed before: nothing changed now."
                    }
                  },
                  "required": [
                    "id",
                    "removed",
                    "removedAt",
                    "replayed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/expenses/{expenseId}/receipt": {
      "put": {
        "operationId": "putExpenseReceipt",
        "tags": [
          "Finances"
        ],
        "summary": "Attach the file of the receipt",
        "description": "The picture (JPEG, PNG) or PDF of the supplier's receipt, sent as the body itself with its media type, at most 5242880 bytes (5 MiB; larger: PAYLOAD_TOO_LARGE). Its kind is read from its first bytes and must be the media type it was sent as. It takes the place of the file in force; the earlier file is kept and is no longer shown. The same file sent again stores nothing (\"replayed\": true, 200).",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "description": "The expense.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "fileName",
            "in": "query",
            "required": false,
            "description": "The name of the file on the caller's side, to name it when it is handed back. Left out: \"receipt\".",
            "schema": {
              "type": "string",
              "maxLength": 120,
              "minLength": 1
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "expenses"
            ]
          }
        ],
        "x-required-scope": "expenses",
        "requestBody": {
          "required": true,
          "description": "The file itself, at most 5 MiB.",
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 5242880
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 5242880
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 5242880
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This file was the receipt in force already: nothing was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing new was stored: the same Idempotency-Key and request were sent before, or the change changed nothing."
                    },
                    "expense": {
                      "$ref": "#/components/schemas/Expense"
                    }
                  },
                  "required": [
                    "replayed",
                    "expense"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The file was stored and is the receipt in force.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing new was stored: the same Idempotency-Key and request were sent before, or the change changed nothing."
                    },
                    "expense": {
                      "$ref": "#/components/schemas/Expense"
                    }
                  },
                  "required": [
                    "replayed",
                    "expense"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "EXPENSE_REFUSED: The expense was not stored. details names each field that was refused with the reason in one fixed word: date-invalid, supplier-missing, supplier-long, amount-invalid, vat-invalid, vat-above-amount, category-unknown, note-long, file-kind (not a JPEG, PNG or PDF by its first bytes, or not the media type it was sent as), file-large, file-empty.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getExpenseReceipt",
        "tags": [
          "Finances"
        ],
        "summary": "The file of the receipt",
        "description": "The file of the supplier's receipt in force, byte for byte as it was sent. Each download is written to the audit log of the business. An expense without a file, and a removed expense, are not found.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "description": "The expense.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "finance"
            ]
          }
        ],
        "x-required-scope": "finance",
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/pos/items": {
      "get": {
        "operationId": "listPosItems",
        "tags": [
          "Register"
        ],
        "summary": "The catalog of the register",
        "description": "Every item in use, in the order of the tiles. An item taken out of the catalog is not listed.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "responses": {
          "200": {
            "description": "The items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 500,
                      "items": {
                        "$ref": "#/components/schemas/PosItem"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/pos/items/{itemCode}": {
      "put": {
        "operationId": "putPosItem",
        "tags": [
          "Register"
        ],
        "summary": "Keep an item by its code",
        "description": "Makes the item of this code (201) or changes it to what was sent (200); the fields left out take their defaults. Sent again with the same body it changes nothing (\"replayed\": true). A change never reaches a document already issued. Each field is checked as the portal checks it; a refusal names every field at fault (POS_ITEM_REFUSED: required, too-long, invalid, too-many) and stores nothing. At most 500 items in use per business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "itemCode",
            "in": "path",
            "required": true,
            "description": "The code of the item.",
            "schema": {
              "type": "string",
              "maxLength": 20,
              "pattern": "^[A-Za-z0-9_.-]{1,20}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PosItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The item of the code, as it stands now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "True when nothing changed."
                    },
                    "item": {
                      "$ref": "#/components/schemas/PosItem"
                    }
                  },
                  "required": [
                    "replayed",
                    "item"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "The item was made.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replayed": {
                      "type": "boolean",
                      "description": "Always false."
                    },
                    "item": {
                      "$ref": "#/components/schemas/PosItem"
                    }
                  },
                  "required": [
                    "replayed",
                    "item"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "POS_ITEM_REFUSED: The item was not stored. details names each field that was refused with the reason in one fixed word: required, too-long, invalid, taken (the code is in use by another item), too-many (500 items in use already).\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removePosItem",
        "tags": [
          "Register"
        ],
        "summary": "Take an item out of the catalog",
        "description": "The item is archived: no tile, no sale. Its row is kept and nothing deletes it; its code is free for another item. A code with no item in use is not found.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "itemCode",
            "in": "path",
            "required": true,
            "description": "The code of the item.",
            "schema": {
              "type": "string",
              "maxLength": 20,
              "pattern": "^[A-Za-z0-9_.-]{1,20}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "responses": {
          "200": {
            "description": "The item is out of the catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 36,
                      "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}$",
                      "description": "The item."
                    },
                    "archived": {
                      "type": "boolean",
                      "description": "Always true."
                    }
                  },
                  "required": [
                    "id",
                    "archived"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/pos/registers": {
      "get": {
        "operationId": "listPosRegisters",
        "tags": [
          "Register"
        ],
        "summary": "The registers",
        "description": "The registers in use of the business, oldest first, each with whether a shift is open and the number of its last close.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "responses": {
          "200": {
            "description": "The registers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registers": {
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "$ref": "#/components/schemas/PosRegister"
                      }
                    }
                  },
                  "required": [
                    "registers"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/pos/closes": {
      "get": {
        "operationId": "listPosCloses",
        "tags": [
          "Register"
        ],
        "summary": "The closes of the registers",
        "description": "Newest first, at most 200; of one register with \"registerId\". Each answer is written to the audit log of the business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "registerId",
            "in": "query",
            "required": false,
            "description": "Only the closes of this register.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "responses": {
          "200": {
            "description": "The closes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "closes": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "$ref": "#/components/schemas/PosClose"
                      }
                    }
                  },
                  "required": [
                    "closes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuers/{issuerId}/pos/closes/{closeId}": {
      "get": {
        "operationId": "getPosClose",
        "tags": [
          "Register"
        ],
        "summary": "One close",
        "description": "A close with its figures as they were stored. Written to the audit log of the business.",
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "description": "The business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "closeId",
            "in": "path",
            "required": true,
            "description": "The close.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "pos"
            ]
          }
        ],
        "x-required-scope": "pos",
        "responses": {
          "200": {
            "description": "The close.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PosClose"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ISSUER_NOT_ACTIVE: The business is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reference": {
      "get": {
        "operationId": "getReference",
        "tags": [
          "Reference"
        ],
        "summary": "The VAT rate and the allocation amount in force today",
        "description": "The standard VAT rate [DOC-61] and the amount above which a tax invoice needs an allocation number [ALC-02], as the server applies them to a document dated today. A caller never sends either: the server fills them.",
        "parameters": [],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The values in force.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reference"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints": {
      "post": {
        "operationId": "createWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Register a webhook address",
        "description": "Registers an address of your system to be told of events by a signed HTTPS POST (see the webhooks section of this file, and INTEGRATION 13). The answer holds the signing secret, once. Events are posted from the moment of registration; nothing earlier is sent, and GET /v1/events holds the earlier ones. At most 16 addresses per client system. The address must be https on port 443 or 8443, and its host a public name or address: an address of a private, loopback, link-local or reserved range is refused, also when a name resolves to one later.",
        "parameters": [],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The address, and its secret.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    },
                    "secret": {
                      "type": "string",
                      "maxLength": 49,
                      "description": "The signing secret, \"whsec_\" and 43 characters. Shown in this answer only: store it now, like a password."
                    }
                  },
                  "required": [
                    "endpoint",
                    "secret"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_ENDPOINT_LIMIT: A client system holds at most 16 webhook addresses that are not deleted (details.limit). Delete one first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.\n\nWEBHOOKS_NOT_CONFIGURED: This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhookEndpoints",
        "tags": [
          "Webhooks"
        ],
        "summary": "Your webhook addresses",
        "description": "Every address of your system that is not deleted, oldest first; with includeDeleted=true the deleted ones too.",
        "parameters": [
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "description": "\"true\" lists the deleted addresses as well.",
            "schema": {
              "type": "string",
              "maxLength": 5,
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The addresses.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "REQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpointId}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "One webhook address",
        "description": "The address, its state and when its secrets were made and end. Never a secret.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "endpoint"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Change a webhook address",
        "description": "Changes the address, its description or the kinds of events it takes, or switches it off (\"enabled\": false: what waited for it is dropped, and can be sent again by hand from the delivery log) and on again (\"enabled\": true, also after the service switched it off for failing). What is left out stays.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "endpoint"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_ENDPOINT_DELETED: The webhook address is deleted. Nothing is posted to it any more; register a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.\n\nWEBHOOKS_NOT_CONFIGURED: This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpointId}/deletion": {
      "post": {
        "operationId": "deleteWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook address",
        "description": "Deletes the address for good: nothing more is posted to it, what waited is dropped, its secrets stop signing at once. Its delivery log stays readable. Sending it again answers the same.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "responses": {
          "200": {
            "description": "The address, deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "endpoint"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpointId}/secret-rotation": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the signing secret",
        "description": "Makes a new signing secret and answers it, once. The secrets that signed until now go on signing beside it for overlapSeconds (24 hours by default): during that time every notice carries two v1 signatures, so your receiver takes the new secret in without missing one. 0 ends the old secrets at once, for a secret that leaked.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A rotation of the signing secret.",
                "properties": {
                  "overlapSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 604800,
                    "description": "How long the secrets that sign now go on signing beside the new one, in seconds: 0 ends them at once, at most 604800 (7 days). Default 86400."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The address, and its new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    },
                    "secret": {
                      "type": "string",
                      "maxLength": 49,
                      "description": "The signing secret, \"whsec_\" and 43 characters. Shown in this answer only: store it now, like a password."
                    }
                  },
                  "required": [
                    "endpoint",
                    "secret"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "MALFORMED_JSON: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_ENDPOINT_DELETED: The webhook address is deleted. Nothing is posted to it any more; register a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PAYLOAD_TOO_LARGE: The request body is larger than the limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE: A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.\n\nWEBHOOKS_NOT_CONFIGURED: This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpointId}/test": {
      "post": {
        "operationId": "sendWebhookTest",
        "tags": [
          "Webhooks"
        ],
        "summary": "Post a test notice now",
        "description": "Posts an \"endpoint.test\" notice to the address now, signed like every notice, and answers how it went: whether your address answered 2xx, its status, or why it could not be reached. Use it to try your check of the signature. A switched-off address takes it too. One test per address every 5 seconds, and ten per client system in a minute over all its addresses, counted before the notice leaves.",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "responses": {
          "200": {
            "description": "How it went. A failure of your address is an answer here, not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "test": {
                      "type": "object",
                      "description": "How the test notice went.",
                      "properties": {
                        "eventId": {
                          "type": "string",
                          "maxLength": 36,
                          "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}$",
                          "description": "The id the test notice carried. A test is no event: GET /v1/events does not know it."
                        },
                        "outcome": {
                          "type": "string",
                          "maxLength": 10,
                          "enum": [
                            "succeeded",
                            "failed"
                          ],
                          "description": "\"succeeded\": your address answered 2xx."
                        },
                        "httpStatus": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "The status your address answered."
                        },
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 40,
                          "description": "Why it failed, one fixed word (see the attempts of a delivery)."
                        },
                        "durationMs": {
                          "type": "integer",
                          "description": "How long it took."
                        }
                      },
                      "required": [
                        "eventId",
                        "outcome",
                        "httpStatus",
                        "error",
                        "durationMs"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "test"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_ENDPOINT_DELETED: The webhook address is deleted. Nothing is posted to it any more; register a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.\n\nWEBHOOK_TEST_TOO_SOON: A test notice was posted to this address a moment ago (one every 5 seconds), or this client system posted ten in the last minute. Wait for the number of seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.\n\nWEBHOOKS_NOT_CONFIGURED: This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{endpointId}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "tags": [
          "Webhooks"
        ],
        "summary": "The delivery log of an address",
        "description": "Every delivery to the address, newest first: the event, where its sending stands, how many tries, the last status and why it failed. status narrows it (for example \"failed\").",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The address.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only deliveries in this state.",
            "schema": {
              "type": "string",
              "maxLength": 10,
              "enum": [
                "pending",
                "sending",
                "succeeded",
                "failed",
                "dropped"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A page of deliveries, newest first.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 36,
                      "description": "Pass as \"cursor\" (or \"after\" for events) to read on; null on the last page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-deliveries/{deliveryId}": {
      "get": {
        "operationId": "getWebhookDelivery",
        "tags": [
          "Webhooks"
        ],
        "summary": "One delivery, with every try",
        "description": "The delivery and every try of it: when, the status your address answered, how long it took, and why it failed. The body of your answers is never kept.",
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "description": "The delivery.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    },
                    "attempts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "One try of a delivery. The body of your answer is never kept.",
                        "properties": {
                          "attemptNo": {
                            "type": "integer",
                            "minimum": 1,
                            "description": "The number of the try, from 1."
                          },
                          "manual": {
                            "type": "boolean",
                            "description": "True: a try you asked for (redelivery)."
                          },
                          "outcome": {
                            "type": "string",
                            "maxLength": 10,
                            "enum": [
                              "succeeded",
                              "failed"
                            ],
                            "description": "\"succeeded\": answered 2xx. \"failed\": anything else."
                          },
                          "httpStatus": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The status your address answered; null when no answer came."
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 40,
                            "description": "Why it failed, one fixed word: refused-url, dns-failed, refused-address, connection-refused, connection-reset, timeout, tls-failed, redirect, http-status, network-error."
                          },
                          "durationMs": {
                            "type": "integer",
                            "description": "How long the try took."
                          },
                          "at": {
                            "type": "string",
                            "maxLength": 30,
                            "format": "date-time",
                            "description": "When it ended. ISO 8601, UTC."
                          }
                        },
                        "required": [
                          "attemptNo",
                          "manual",
                          "outcome",
                          "httpStatus",
                          "error",
                          "durationMs",
                          "at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "delivery",
                    "attempts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-deliveries/{deliveryId}/redelivery": {
      "post": {
        "operationId": "redeliverWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a delivery again",
        "description": "Sends a delivery that succeeded, failed or was dropped once more, within seconds: one try, the same event and the same event id. It does not count toward switching the address off. Read the delivery to see how it went. A delivery that is still waiting or being sent answers WEBHOOK_DELIVERY_PENDING.",
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "description": "The delivery.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "webhooks"
            ]
          }
        ],
        "x-required-scope": "webhooks",
        "responses": {
          "200": {
            "description": "The delivery, waiting for its try.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    },
                    "attempts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "One try of a delivery. The body of your answer is never kept.",
                        "properties": {
                          "attemptNo": {
                            "type": "integer",
                            "minimum": 1,
                            "description": "The number of the try, from 1."
                          },
                          "manual": {
                            "type": "boolean",
                            "description": "True: a try you asked for (redelivery)."
                          },
                          "outcome": {
                            "type": "string",
                            "maxLength": 10,
                            "enum": [
                              "succeeded",
                              "failed"
                            ],
                            "description": "\"succeeded\": answered 2xx. \"failed\": anything else."
                          },
                          "httpStatus": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The status your address answered; null when no answer came."
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 40,
                            "description": "Why it failed, one fixed word: refused-url, dns-failed, refused-address, connection-refused, connection-reset, timeout, tls-failed, redirect, http-status, network-error."
                          },
                          "durationMs": {
                            "type": "integer",
                            "description": "How long the try took."
                          },
                          "at": {
                            "type": "string",
                            "maxLength": 30,
                            "format": "date-time",
                            "description": "When it ended. ISO 8601, UTC."
                          }
                        },
                        "required": [
                          "attemptNo",
                          "manual",
                          "outcome",
                          "httpStatus",
                          "error",
                          "durationMs",
                          "at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "delivery",
                    "attempts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "WEBHOOK_DELIVERY_PENDING: The delivery is still waiting for its next try, or is being sent at this moment. Ask again once it ended.\n\nWEBHOOK_ENDPOINT_DELETED: The webhook address is deleted. Nothing is posted to it any more; register a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.\n\nWEBHOOKS_NOT_CONFIGURED: This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Webhooks"
        ],
        "summary": "The events meant for your system",
        "description": "The events meant for your system, oldest first: every event of the businesses that give it a standing grant, and those about your system itself. Keep the id of the last event you handled and ask with after=<that id>: you miss nothing, also while your address was down or when you have none. Works without any webhook address.",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The id of the last event you handled; left out: from the first.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only events of this kind.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "issuerId",
            "in": "query",
            "required": false,
            "description": "Only events of this business.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items a page: 1 to 200. Default 50.",
            "schema": {
              "type": "string",
              "maxLength": 3,
              "pattern": "^[1-9][0-9]{0,2}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Events, oldest first.",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEvent"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 36,
                      "description": "Pass as \"cursor\" (or \"after\" for events) to read on; null on the last page."
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INPUT_INVALID: A value of the request is not usable; details.field names it.\n\nREQUEST_INVALID: The request is not in the form this route takes; details name the place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{eventId}": {
      "get": {
        "operationId": "getEvent",
        "tags": [
          "Webhooks"
        ],
        "summary": "One event",
        "description": "The event, when it was meant for your system. A receiver that wants to be sure a notice is true reads the event, or the thing it names, with its own key.",
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "The event.",
            "schema": {
              "type": "string",
              "maxLength": 36,
              "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}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read"
            ]
          }
        ],
        "x-required-scope": "read",
        "responses": {
          "200": {
            "description": "The event.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "event": {
                      "$ref": "#/components/schemas/WebhookEvent"
                    }
                  },
                  "required": [
                    "event"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "KEY_ADDRESS_NOT_ALLOWED: The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.\n\nKEY_SCOPE_MISSING: The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: Too many requests. Wait for the number of seconds in the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL: The request failed inside the service. Nothing is known to have changed; the requestId identifies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UNAVAILABLE: The service is not accepting requests right now. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "document.issued": {
      "post": {
        "operationId": "notice_document_issued",
        "summary": "A document was issued: through the API by any client system, or by the business in its portal.",
        "description": "A document was issued: through the API by any client system, or by the business in its portal. Read: GET /v1/documents/{documentId}. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a document.issued notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "document.issued"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "document.cancelled": {
      "post": {
        "operationId": "notice_document_cancelled",
        "summary": "A document was cancelled before its original left the business.",
        "description": "A document was cancelled before its original left the business. Read: GET /v1/documents/{documentId}/delivery. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a document.cancelled notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "document.cancelled"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "draft.confirmed": {
      "post": {
        "operationId": "notice_draft_confirmed",
        "summary": "A draft this client system prepared became a document. Sent beside document.issued, to this system only.",
        "description": "A draft this client system prepared became a document. Sent beside document.issued, to this system only. Read: GET /v1/drafts/{draftId}. Sent to this client system only. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a draft.confirmed notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "draft.confirmed"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "draftId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The draft."
                      },
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "draftId",
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "draft.expired": {
      "post": {
        "operationId": "notice_draft_expired",
        "summary": "A draft this client system prepared passed its time without a confirm. Nothing was issued; prepare again under a new Idempotency-Key.",
        "description": "A draft this client system prepared passed its time without a confirm. Nothing was issued; prepare again under a new Idempotency-Key. Read: GET /v1/drafts/{draftId}. Sent to this client system only. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a draft.expired notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "draft.expired"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "draftId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The draft."
                      }
                    },
                    "required": [
                      "draftId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "delivery.opened": {
      "post": {
        "operationId": "notice_delivery_opened",
        "summary": "The page of a personal link was opened for the first time (a mail scanner that opens links counts as well). Once per link.",
        "description": "The page of a personal link was opened for the first time (a mail scanner that opens links counts as well). Once per link. Read: GET /v1/documents/{documentId}/delivery. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a delivery.opened notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "delivery.opened"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      },
                      "linkId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The personal link."
                      }
                    },
                    "required": [
                      "documentId",
                      "linkId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "delivery.downloaded": {
      "post": {
        "operationId": "notice_delivery_downloaded",
        "summary": "A file of the document was taken through a personal link: the original the first time, a copy after it.",
        "description": "A file of the document was taken through a personal link: the original the first time, a copy after it. Read: GET /v1/documents/{documentId}/delivery. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a delivery.downloaded notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "delivery.downloaded"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      },
                      "linkId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The personal link."
                      },
                      "deliveryId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The record of the hand-over through the link (GET /v1/documents/{documentId}/delivery)."
                      }
                    },
                    "required": [
                      "documentId",
                      "linkId",
                      "deliveryId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "consent.changed": {
      "post": {
        "operationId": "notice_consent_changed",
        "summary": "A customer gave, or withdrew, consent to computerized documents of the business.",
        "description": "A customer gave, or withdrew, consent to computerized documents of the business. Read: GET /v1/issuers/{issuerId}/customers/{customerKey}/consent. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a consent.changed notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "consent.changed"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "customerKey": {
                        "type": "string",
                        "maxLength": 15,
                        "description": "The key of the customer."
                      }
                    },
                    "required": [
                      "customerKey"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "allocation.received": {
      "post": {
        "operationId": "notice_allocation_received",
        "summary": "A tax invoice received its allocation number, from the Tax Authority or typed in.",
        "description": "A tax invoice received its allocation number, from the Tax Authority or typed in. Read: GET /v1/documents/{documentId}/allocation. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a allocation.received notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "allocation.received"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "allocation.held": {
      "post": {
        "operationId": "notice_allocation_held",
        "summary": "The Tax Authority held the request for an allocation number: the business must choose how to go on.",
        "description": "The Tax Authority held the request for an allocation number: the business must choose how to go on. Read: GET /v1/documents/{documentId}/allocation. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a allocation.held notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "allocation.held"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "allocation.failed": {
      "post": {
        "operationId": "notice_allocation_failed",
        "summary": "The Tax Authority refused the request for an allocation number, or found its details wrong. A request that failed on the way is tried again by the service and is not an event.",
        "description": "The Tax Authority refused the request for an allocation number, or found its details wrong. A request that failed on the way is tried again by the service and is not an event. Read: GET /v1/documents/{documentId}/allocation. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a allocation.failed notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "allocation.failed"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The document."
                      }
                    },
                    "required": [
                      "documentId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "transmission.status_changed": {
      "post": {
        "operationId": "notice_transmission_status_changed",
        "summary": "The Tax Authority stated a new status of a file of a transmitted uniform-structure production.",
        "description": "The Tax Authority stated a new status of a file of a transmitted uniform-structure production. Read: GET /v1/issuers/{issuerId}/uniform-exports/{exportId}/transmission. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a transmission.status_changed notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "transmission.status_changed"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "exportId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The production of the uniform-structure file."
                      },
                      "file": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 3,
                        "enum": [
                          "ini",
                          "bkm",
                          null
                        ],
                        "description": "The file of the production: \"ini\" or \"bkm\"."
                      }
                    },
                    "required": [
                      "exportId",
                      "file"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "transmission.failed": {
      "post": {
        "operationId": "notice_transmission_failed",
        "summary": "An attempt to transmit a uniform-structure production was refused or failed. Once per attempt.",
        "description": "An attempt to transmit a uniform-structure production was refused or failed. Once per attempt. Read: GET /v1/issuers/{issuerId}/uniform-exports/{exportId}/transmission. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a transmission.failed notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "transmission.failed"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "exportId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The production of the uniform-structure file."
                      }
                    },
                    "required": [
                      "exportId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "issuer.activated": {
      "post": {
        "operationId": "notice_issuer_activated",
        "summary": "The owner activated the business. Sent to the client systems it granted, and to the one that added it.",
        "description": "The owner activated the business. Sent to the client systems it granted, and to the one that added it. Read: GET /v1/issuers/{issuerId}. Sent to every client system that holds a standing grant of the business. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a issuer.activated notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "issuer.activated"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "issuer.granted": {
      "post": {
        "operationId": "notice_issuer_granted",
        "summary": "The business gave this client system permission to act for it.",
        "description": "The business gave this client system permission to act for it. Read: GET /v1/issuers/{issuerId}. Sent to this client system only. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a issuer.granted notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "issuer.granted"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "issuer.revoked": {
      "post": {
        "operationId": "notice_issuer_revoked",
        "summary": "The business withdrew the permission of this client system. Every later call of this system for the business answers 404, and its events stop.",
        "description": "The business withdrew the permission of this client system. Every later call of this system for the business answers 404, and its events stop. Read: GET /v1/issuers (the business is no longer listed). Sent to this client system only. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a issuer.revoked notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "issuer.revoked"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    },
    "endpoint.test": {
      "post": {
        "operationId": "notice_endpoint_test",
        "summary": "A test notice you asked for (POST /v1/webhook-endpoints/{endpointId}/test). It is of no business and is not an event.",
        "description": "A test notice you asked for (POST /v1/webhook-endpoints/{endpointId}/test). It is of no business and is not an event. Nothing to read. The body holds identifiers only: read the details with your API key, which is also how you know the notice told the truth.",
        "parameters": [
          {
            "name": "Tring-Signature",
            "description": "\"t=<unix seconds>,v1=<hex>[,v1=<hex>]\": HMAC-SHA256 of \"<t>.<raw body>\" under the secret of the address (\"whsec_...\", as UTF-8). One v1 per secret that signs, two during a rotation. Refuse a notice whose t is more than 300 seconds from your clock, or with no v1 that equals your own, compared in constant time.",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Id",
            "description": "The id of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Event-Type",
            "description": "The kind of the event, as in the body.",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "in": "header",
            "required": true
          },
          {
            "name": "Tring-Delivery-Id",
            "description": "The delivery (GET /v1/webhook-deliveries/{deliveryId}); absent on a test notice.",
            "schema": {
              "type": "string",
              "maxLength": 36
            },
            "in": "header",
            "required": false
          },
          {
            "name": "Tring-Delivery-Attempt",
            "description": "The number of this try of the delivery, from 1.",
            "schema": {
              "type": "string",
              "maxLength": 4
            },
            "in": "header",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The body of a endpoint.test notice: thin, identifiers only. Read the details with your key.",
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 36,
                    "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}$",
                    "description": "The event. The same event is the same id at every try: keep it, and do nothing twice for one id."
                  },
                  "object": {
                    "type": "string",
                    "maxLength": 5,
                    "enum": [
                      "event"
                    ],
                    "description": "Always \"event\"."
                  },
                  "type": {
                    "type": "string",
                    "maxLength": 40,
                    "enum": [
                      "endpoint.test"
                    ],
                    "description": "The kind of the event."
                  },
                  "created": {
                    "type": "string",
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When it happened, by the clock of the database. ISO 8601, UTC."
                  },
                  "environment": {
                    "type": "string",
                    "maxLength": 10,
                    "enum": [
                      "sandbox",
                      "production"
                    ],
                    "description": "\"sandbox\" or \"production\": the deployment that sent it."
                  },
                  "issuerId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 36,
                    "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}$",
                    "description": "Null: a test notice is of no business."
                  },
                  "data": {
                    "type": "object",
                    "description": "The identifiers of the event.",
                    "properties": {
                      "endpointId": {
                        "type": "string",
                        "maxLength": 36,
                        "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}$",
                        "description": "The address the test notice was posted to."
                      }
                    },
                    "required": [
                      "endpointId"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created",
                  "environment",
                  "issuerId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Taken. Answer within 10 seconds, before doing the work: the body of the answer is not read."
          },
          "default": {
            "description": "Anything else (a 3xx too: no redirect is followed) is a failure, tried again for three days."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The API key of the client system: \"kbl_test_...\" for a sandbox deployment, \"kbl_live_...\" for production. Each key holds scopes; each operation names the one it needs. read: Read: every GET route but those of the finances (businesses, drafts, documents and their copies, customers, delivery records, uniform files and reports, transmission and allocation state, backups, reference data) and the lookups of a received invoice. issue: Issue: prepare and confirm a document, cancel one, and the allocation numbers of the Tax Authority (ask, record, decide). delivery: Delivery: make, revoke and email a personal link, and report or withdraw the consent of a customer. records: Records: produce a uniform-structure file, transmit it and ask for its status, and start a backup. businesses: Businesses: add a business to the register, and choose the design of the documents of a business this client serves. Never held by a key of the direct connection of a business, whose owner chooses the design in the portal. webhooks: Webhooks: manage the subscriptions to events of the client system. finance: Finance: read the year of a business (income, expenses and profit by month, by customer and by category), its expenses and the file of the receipt of each. Held only by a key of the direct connection of the business. expenses: Expenses: record, correct and remove an expense of the business, and attach the file of its receipt. Held only by a key of the direct connection of the business. pos: Register: read the catalog, the registers and the closes of the register of the business, and keep its catalog by item code. Held only by a key of the direct connection of the business."
      }
    },
    "schemas": {
      "PrepareRequest": {
        "type": "object",
        "description": "What to issue. The server computes every amount, the VAT rate, every number and the production time; a key that is not listed here is refused, not ignored. An optional key may be left out or be null.",
        "properties": {
          "docType": {
            "type": "integer",
            "enum": [
              300,
              305,
              320,
              330,
              400
            ],
            "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
          },
          "documentDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The date printed on the document. \"YYYY-MM-DD\"."
          },
          "priceMode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "enum": [
              "net",
              "gross",
              null
            ],
            "description": "net: unit prices are before VAT. gross: unit prices include VAT. Null on a receipt (400)."
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "description": "The customer as printed on the document.",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 15,
                "pattern": "^[A-Za-z0-9_.-]{1,15}$",
                "description": "The stable key of an existing customer of the business [UNI-27]. Send this or externalRef, so that all documents of one customer share one account."
              },
              "externalRef": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 255,
                "description": "The identifier of the customer in the caller's own system. The first use creates the customer; later uses find it."
              },
              "name": {
                "type": "string",
                "maxLength": 200,
                "description": "The name printed on the document."
              },
              "registrationNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "The buyer's dealer or company number, nine digits."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Country."
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 30,
                "description": "Telephone."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "maxItems": 9999,
            "description": "Item lines: on 300, 305, 320 and 330. None on a receipt.",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "What was sold."
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Unit of measure."
                },
                "quantity": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{4}$",
                  "description": "Quantity. Decimal text with exactly four decimals (\"1.0000\")."
                },
                "unitPrice": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Price of one unit, in the price mode of the document. Decimal text with exactly two decimals, never a JSON number."
                },
                "discount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount, in the price mode of the document. Decimal text with exactly two decimals, never a JSON number."
                },
                "vatKind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard: taxed at the rate in force; zero: zero rate; exempt."
                },
                "base": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Credit note only: the invoice this line goes against, when the credit note names more than one.",
                  "properties": {
                    "docType": {
                      "type": "integer",
                      "enum": [
                        300,
                        305,
                        320,
                        330,
                        400
                      ],
                      "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                    },
                    "number": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "The number of the document."
                    }
                  },
                  "required": [
                    "docType",
                    "number"
                  ],
                  "additionalProperties": false
                },
                "itemCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Item code (field 1259)."
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice",
                "vatKind"
              ],
              "additionalProperties": false
            }
          },
          "correctionLines": {
            "type": "array",
            "maxItems": 9999,
            "description": "Only on a transaction invoice (300) with `corrects` that also holds a new transaction, the form סעיף 23א(2)(א) itself writes [DOC-76]: `lines` are the new transaction, and these are the lines of the correction, quantities and prices above zero, at the VAT rate of the corrected invoice. The document is issued above zero: the new transaction (\"סכום החשבונית\"), then after it the credit or the charge and the corrected amount. A credit is below the amount of the new transaction, at every VAT kind and rate (CORRECTION_EXCEEDS_INVOICE), and never passes what the corrected invoice still stands at; no document discount. Left out or null: the lines are the correction itself, as on any correcting transaction invoice.",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "What was sold."
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Unit of measure."
                },
                "quantity": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{4}$",
                  "description": "Quantity. Decimal text with exactly four decimals (\"1.0000\")."
                },
                "unitPrice": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Price of one unit, in the price mode of the document. Decimal text with exactly two decimals, never a JSON number."
                },
                "discount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount, in the price mode of the document. Decimal text with exactly two decimals, never a JSON number."
                },
                "vatKind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard: taxed at the rate in force; zero: zero rate; exempt."
                },
                "base": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Credit note only: the invoice this line goes against, when the credit note names more than one.",
                  "properties": {
                    "docType": {
                      "type": "integer",
                      "enum": [
                        300,
                        305,
                        320,
                        330,
                        400
                      ],
                      "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                    },
                    "number": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "The number of the document."
                    }
                  },
                  "required": [
                    "docType",
                    "number"
                  ],
                  "additionalProperties": false
                },
                "itemCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Item code (field 1259)."
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice",
                "vatKind"
              ],
              "additionalProperties": false
            }
          },
          "discount": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Document discount. Decimal text with exactly two decimals, never a JSON number."
          },
          "payments": {
            "type": "array",
            "maxItems": 9999,
            "description": "Payment lines: on 320 and 400.",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9,
                  "description": "Means of payment (field 1306): 1 cash, 2 cheque, 3 credit card, 4 bank transfer, 5 voucher, 6 exchange slip, 7 note, 8 standing order, 9 other."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount received by this means. Decimal text with exactly two decimals, never a JSON number."
                },
                "bankNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Cheque or note: bank number, digits."
                },
                "branchNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Cheque or note: branch number, digits."
                },
                "accountNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 15,
                  "description": "Cheque: account number, digits."
                },
                "chequeNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Cheque or note: its number, digits."
                },
                "dueDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Due date of a cheque, a note or a card charge. \"YYYY-MM-DD\"."
                },
                "cardAcquirer": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    6,
                    null
                  ],
                  "description": "Card only (field 1313): 1 Isracard, 2 Cal, 3 Diners, 4 American Express, 6 Leumi Card."
                },
                "cardName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Card only: the name of the card."
                },
                "cardDealType": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 5,
                  "description": "Card only (field 1315): 1 regular, 2 instalments, 3 credit, 4 deferred, 5 other."
                },
                "cardInstallments": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 999,
                  "description": "Card only: number of instalments."
                },
                "cardLast4": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4,
                  "pattern": "^[0-9]{4}$",
                  "description": "Card only: the last four digits."
                },
                "methodDetail": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Free detail of the means of payment."
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Reference of the payment (a transfer number, a transaction id)."
                },
                "crossedNotNegotiable": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Cheque only: true when the cheque is crossed, drawn in the customer's name, marked \"לא סחיר\" and to the order of the business only. Printed on the document; where the business applies the payment-means condition of a secured signature (a setting), only such a cheque lets the document be sent by computer [SIG-10]."
                }
              },
              "required": [
                "method",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "paymentDate": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The day the payment was received (320, 400). \"YYYY-MM-DD\"."
          },
          "paymentNature": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Receipt: what the payment is for."
          },
          "withholding": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Receipt only: tax withheld at source. Decimal text with exactly two decimals, never a JSON number."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Credit note: the reason of the credit. A correcting transaction invoice (300 with `corrects`): the reason of the change. Mandatory on both; on no other document."
          },
          "badDebt": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Credit note: the credit is for a bad debt."
          },
          "creditedInvoices": {
            "type": "array",
            "maxItems": 9999,
            "description": "Credit note: the invoices it credits, by type and number.",
            "items": {
              "type": "object",
              "properties": {
                "docType": {
                  "type": "integer",
                  "enum": [
                    305,
                    320
                  ],
                  "description": "305 or 320."
                },
                "number": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The number of the credited invoice."
                },
                "amount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The part of the credit note that goes against this invoice, VAT included. May be left out when one invoice is credited. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "docType",
                "number"
              ],
              "additionalProperties": false
            }
          },
          "corrects": {
            "type": [
              "object",
              "null"
            ],
            "description": "On 300 and 400 only: the earlier document of the same business and customer that this one corrects, after its \"מקור\" left the business (before that it is cancelled). A receipt (400) with `corrects` is a cancelling receipt: it takes back the whole of a receipt (400), or the whole payment recorded on a tax invoice / receipt (320), once; send docType, documentDate and corrects, and optionally paymentDate and notes; the customer, the payment lines, what the payment was for, the tax withheld and the foreign currency are taken from the corrected document and must not be sent; every amount is issued below zero. A cancelling receipt of a 320 returns the money only: the sale and its VAT are reduced by a credit note (330), a document of its own, and while the 320 is not credited in full the draft carries the warning CANCELLED_PAYMENT_INVOICE_STANDS. A receipt (400) with `corrects` and effect `cancel-part` is a partial cancelling receipt [DOC-75]: it takes back a part of what was received on a receipt or on a 320, up to what is left of it, the rest included, and may follow other parts; send docType, documentDate, corrects, payments (above zero: the money that went back and by which means, with the details that means asks for) and optionally paymentDate and notes; the customer is taken from the corrected document, what the payment was for is a fixed sentence that names it, and paymentNature, withholding and foreignCurrency must not be sent; every amount is issued below zero. A part may not follow a cancellation in full (RECEIPT_ALREADY_CANCELLED), and after a part the rest is taken back by a further part (RECEIPT_PARTLY_CANCELLED); of a 320 that stands at more than the payment left, the draft carries the warning PARTLY_CANCELLED_PAYMENT_INVOICE_STANDS. A transaction invoice (300) with `corrects` is a correcting transaction invoice under סעיף 23א(2)(א): send the lines of the change (quantities and prices above zero), the effect and the reason; the customer is taken from the corrected invoice and must not be sent; a credit carries no discount and never passes what the corrected invoice still stands at. To write the correction on a transaction invoice that also holds a new transaction, send the new transaction in `lines` and the correction in `correctionLines` [DOC-76].",
            "properties": {
              "docType": {
                "type": "integer",
                "enum": [
                  300,
                  320,
                  400
                ],
                "description": "The type of the corrected document. On a transaction invoice: 300. On a receipt: 400, or 320 to take back the payment recorded on a tax invoice / receipt."
              },
              "number": {
                "type": "integer",
                "minimum": 1,
                "description": "The number of the corrected document."
              },
              "effect": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 11,
                "enum": [
                  "cancel",
                  "cancel-part",
                  "credit",
                  "charge",
                  null
                ],
                "description": "What the correction does. On a transaction invoice (300), mandatory: credit reduces the corrected invoice and the document is issued below zero; charge adds to it. On a receipt (400): cancel, which may be left out, takes back the whole receipt or the whole payment of a tax invoice / receipt; cancel-part takes back a part of it with payment lines of its own [DOC-75]."
              }
            },
            "required": [
              "docType",
              "number"
            ],
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "maxItems": 9999,
            "description": "On 300, 305, 320 and 400: for example the invoice a receipt pays. Not on a document that corrects another: it names that document in `corrects`.",
            "items": {
              "type": "object",
              "description": "An issued document of the same business this one relates to.",
              "properties": {
                "docType": {
                  "type": "integer",
                  "enum": [
                    300,
                    305,
                    320,
                    330,
                    400
                  ],
                  "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                },
                "number": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The number of the document."
                }
              },
              "required": [
                "docType",
                "number"
              ],
              "additionalProperties": false
            }
          },
          "deliveryNote": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "number": {
                "type": "string",
                "maxLength": 50,
                "description": "Number of a delivery note made elsewhere."
              },
              "date": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its date. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "number",
              "date"
            ],
            "additionalProperties": false
          },
          "foreignCurrency": {
            "type": [
              "object",
              "null"
            ],
            "description": "320 and 400: a payment made in foreign currency, as stated data. The document stays in shekels.",
            "properties": {
              "code": {
                "type": "string",
                "maxLength": 3,
                "description": "ISO 4217 currency code."
              },
              "amount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The amount paid in that currency. Decimal text with exactly two decimals, never a JSON number."
              }
            },
            "required": [
              "code",
              "amount"
            ],
            "additionalProperties": false
          },
          "buyerDemandedAllocation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The buyer demanded an allocation number."
          },
          "expectedTotal": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The total the caller expects. A different computed total refuses the request. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "A free remark printed on the document."
          },
          "expectedPaymentMethods": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 3,
            "description": "On 300 and 305 only: the means by which the payment of this invoice will be received, one to three of the three the payment-means condition of a secured signature allows (bookkeeping rules סעיף 18ב(ד)). Printed on the invoice. Where the business applies the condition (a setting), an invoice that states none is not sent by computer [SIG-10].",
            "items": {
              "type": "integer",
              "enum": [
                2,
                3,
                4
              ],
              "description": "A means of payment (field 1306): 2 a crossed cheque, \"לא סחיר\", in the customer's name; 3 the customer's credit card; 4 a transfer from the customer's bank account."
            }
          },
          "reverseChargeOf": {
            "type": [
              "object",
              "null"
            ],
            "description": "On 305 only: this is the zero-rate tax invoice of a reverse charge (VAT law סעיף 47(א3)), issued in place of the tax invoice named here, which the Authority held and whose buyer took the tax upon itself. Send the customer of that invoice by its key, every line at zero rate, for the same amount without VAT. The rendering prints the two sentences of a reverse charge from this link; nobody types them. Then report the choice with the allocation call [ALC-23].",
            "properties": {
              "docType": {
                "type": "integer",
                "enum": [
                  305,
                  320
                ],
                "description": "305 or 320."
              },
              "number": {
                "type": "integer",
                "minimum": 1,
                "description": "Its number."
              }
            },
            "required": [
              "docType",
              "number"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "docType",
          "documentDate"
        ],
        "additionalProperties": false
      },
      "PreparedDocument": {
        "type": "object",
        "description": "The document as the server computed it from the request.",
        "properties": {
          "docType": {
            "type": "integer",
            "enum": [
              300,
              305,
              320,
              330,
              400
            ],
            "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
          },
          "issuerVatStatus": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "licensed",
              "exempt"
            ],
            "description": "The dealer type the document was computed under."
          },
          "issuerProfileVersion": {
            "type": "integer",
            "description": "The version of the business details in force on the document date."
          },
          "documentDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The document date. \"YYYY-MM-DD\"."
          },
          "priceMode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "enum": [
              "net",
              "gross",
              null
            ],
            "description": "net or gross; null on a receipt."
          },
          "vatPresentation": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "separate",
              "included",
              "none"
            ],
            "description": "separate: the amount without VAT, the VAT and the total are shown apart (every document with VAT, a transaction invoice of a licensed dealer included). none: the document has no VAT (a receipt; any document of an exempt dealer). included: no draft is computed with it any more."
          },
          "customer": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200,
                "description": "Name."
              },
              "registrationNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "description": "Dealer or company number."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Country."
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 30,
                "description": "Telephone."
              }
            },
            "required": [
              "name",
              "registrationNumber",
              "street",
              "houseNumber",
              "city",
              "postalCode",
              "country",
              "phone"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineNo": {
                  "type": "integer",
                  "description": "Line number, from 1."
                },
                "description": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Description."
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Unit."
                },
                "quantity": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{4}$",
                  "description": "Quantity. Decimal text with exactly four decimals (\"1.0000\"); with a leading minus on a line of a document below zero."
                },
                "unitPrice": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Unit price as entered. Never below zero: the quantity carries the sign of a line. Decimal text with exactly two decimals, never a JSON number."
                },
                "discount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount as entered. Decimal text with exactly two decimals, never a JSON number."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line amount in the price mode of the document. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "unitPriceNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Unit price without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "discountNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "netAmount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "vatKind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard, zero or exempt."
                },
                "vatRate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "The rate of the line; \"0.00\" on zero-rate and exempt lines; null when the document has no VAT. Percent as decimal text (\"18.00\")."
                },
                "base": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "The invoice the line goes against: the credited invoice on a credit note, the corrected invoice on a correcting transaction invoice.",
                  "properties": {
                    "docType": {
                      "type": "integer",
                      "enum": [
                        300,
                        305,
                        320,
                        330,
                        400
                      ],
                      "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                    },
                    "number": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "The number of the document."
                    }
                  },
                  "required": [
                    "docType",
                    "number"
                  ],
                  "additionalProperties": false
                },
                "itemCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Item code."
                }
              },
              "required": [
                "lineNo",
                "description",
                "unit",
                "quantity",
                "unitPrice",
                "discount",
                "amount",
                "unitPriceNet",
                "discountNet",
                "netAmount",
                "vatKind",
                "vatRate",
                "base",
                "itemCode"
              ],
              "additionalProperties": false
            }
          },
          "vatGroups": {
            "type": "array",
            "description": "Totals per VAT kind and rate. Empty when the document has no VAT.",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard, zero or exempt."
                },
                "vatRate": {
                  "type": "string",
                  "maxLength": 10,
                  "description": "The rate of the group. Percent as decimal text (\"18.00\")."
                },
                "subtotal": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Sum of the line amounts. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "discount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Share of the document discount. Decimal text with exactly two decimals, never a JSON number."
                },
                "netBeforeDiscount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount without VAT before the discount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "discountNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The discount without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "net": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "vat": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "total": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount with VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                }
              },
              "required": [
                "kind",
                "vatRate",
                "subtotal",
                "discount",
                "netBeforeDiscount",
                "discountNet",
                "net",
                "vat",
                "total"
              ],
              "additionalProperties": false
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineNo": {
                  "type": "integer",
                  "description": "Line number, from 1."
                },
                "method": {
                  "type": "integer",
                  "description": "Means of payment, 1 to 9."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "bankNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Bank number."
                },
                "branchNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Branch number."
                },
                "accountNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 15,
                  "description": "Account number."
                },
                "chequeNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Cheque number."
                },
                "dueDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Due date. \"YYYY-MM-DD\"."
                },
                "cardAcquirer": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Card acquirer."
                },
                "cardName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Card name."
                },
                "cardDealType": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Kind of card deal."
                },
                "cardInstallments": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Instalments."
                },
                "cardLast4": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4,
                  "description": "Last four digits."
                },
                "methodDetail": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Detail."
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Reference."
                },
                "crossedNotNegotiable": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Cheque only: stated crossed, in the customer's name, \"לא סחיר\", to the order of the business only [SIG-10]. Null when not stated."
                }
              },
              "required": [
                "lineNo",
                "method",
                "amount",
                "bankNumber",
                "branchNumber",
                "accountNumber",
                "chequeNumber",
                "dueDate",
                "cardAcquirer",
                "cardName",
                "cardDealType",
                "cardInstallments",
                "cardLast4",
                "methodDetail",
                "reference",
                "crossedNotNegotiable"
              ],
              "additionalProperties": false
            }
          },
          "paymentDate": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Payment date. \"YYYY-MM-DD\"."
          },
          "paymentNature": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "What the payment is for."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Reason of the credit."
          },
          "badDebt": {
            "type": "boolean",
            "description": "Bad-debt credit note."
          },
          "creditedInvoices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "docType": {
                  "type": "integer",
                  "description": "305 or 320."
                },
                "number": {
                  "type": "integer",
                  "description": "Number."
                },
                "date": {
                  "type": "string",
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Its date. \"YYYY-MM-DD\"."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The part credited, VAT included. Decimal text with exactly two decimals, never a JSON number."
                },
                "documentId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The credited document."
                }
              },
              "required": [
                "docType",
                "number",
                "date",
                "amount",
                "documentId"
              ],
              "additionalProperties": false
            }
          },
          "correction": {
            "type": [
              "object",
              "null"
            ],
            "description": "The earlier document this one corrects [DOC-56, DOC-73, DOC-75]; null on a document that corrects nothing.",
            "properties": {
              "docType": {
                "type": "integer",
                "enum": [
                  300,
                  320,
                  400
                ],
                "description": "The type of the corrected document: 300, 400, or 320 when a cancelling receipt takes back the payment of a tax invoice / receipt."
              },
              "number": {
                "type": "integer",
                "description": "Its number."
              },
              "date": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its date. \"YYYY-MM-DD\"."
              },
              "documentId": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The corrected document."
              },
              "effect": {
                "type": "string",
                "maxLength": 11,
                "enum": [
                  "cancel",
                  "cancel-part",
                  "credit",
                  "charge"
                ],
                "description": "cancel: a receipt, or the payment of a tax invoice / receipt, taken back in full. cancel-part: a part of it taken back. credit: a transaction invoice reduced. charge: a transaction invoice added to."
              },
              "correctedAmount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "What the corrected document stands at after this one, VAT included: after a cancelling receipt, what is left of the money received on it (\"0.00\" after a cancellation in full; of a 320, of the payment recorded on it); on a correcting transaction invoice, what the corrected invoice stands at after it. Decimal text with exactly two decimals, never a JSON number."
              },
              "onTransaction": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "On a transaction invoice that holds a new transaction and the correction of an earlier one [DOC-76]; null on every other correcting document.",
                "properties": {
                  "transactionNet": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The new transaction without VAT. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "transactionVat": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "Its VAT; \"0.00\" for an exempt dealer. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "transactionAmount": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The new transaction, VAT included, before the correction: the amount the section writes the correction after, printed as the subtotal \"סה\"כ העסקה החדשה\". The bottom line of the document is its total. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "correctionAmount": {
                    "type": "string",
                    "maxLength": 21,
                    "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "\"סכום החיוב או הזיכוי\": what the correction lines change, VAT included; below zero for a credit. transactionAmount plus this is the total of the document, the corrected amount the customer pays. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                  }
                },
                "required": [
                  "transactionNet",
                  "transactionVat",
                  "transactionAmount",
                  "correctionAmount"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "docType",
              "number",
              "date",
              "documentId",
              "effect",
              "correctedAmount",
              "onTransaction"
            ],
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "docType": {
                  "type": "integer",
                  "enum": [
                    300,
                    305,
                    320,
                    330,
                    400
                  ],
                  "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                },
                "number": {
                  "type": "integer",
                  "description": "Number."
                },
                "documentId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The related document."
                }
              },
              "required": [
                "docType",
                "number",
                "documentId"
              ],
              "additionalProperties": false
            }
          },
          "deliveryNote": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "number": {
                "type": "string",
                "maxLength": 50,
                "description": "Number."
              },
              "date": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Date. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "number",
              "date"
            ],
            "additionalProperties": false
          },
          "foreignCurrency": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "maxLength": 3,
                "description": "Currency code."
              },
              "amount": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount in that currency. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              }
            },
            "required": [
              "code",
              "amount"
            ],
            "additionalProperties": false
          },
          "buyerDemandedAllocation": {
            "type": "boolean",
            "description": "The buyer demanded an allocation number."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Remark."
          },
          "expectedPaymentMethods": {
            "type": [
              "array",
              "null"
            ],
            "description": "The means the invoice will be paid by [SIG-10].",
            "items": {
              "type": "integer",
              "description": "A means of payment, 2, 3 or 4."
            }
          },
          "reverseChargeOf": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "docType": {
                "type": "integer",
                "enum": [
                  300,
                  305,
                  320,
                  330,
                  400
                ],
                "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
              },
              "number": {
                "type": "integer",
                "description": "Number."
              },
              "documentId": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The tax invoice this zero-rate invoice of a reverse charge replaces [ALC-23]."
              }
            },
            "required": [
              "docType",
              "number",
              "documentId"
            ],
            "additionalProperties": false
          },
          "amounts": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Sum of the line amounts. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "discount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Document discount. Decimal text with exactly two decimals, never a JSON number."
              },
              "netBeforeDiscount": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount without VAT before the discount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "discountNet": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The discount without VAT. Decimal text with exactly two decimals, never a JSON number."
              },
              "net": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "vat": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "VAT; null when the document has no VAT at all. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "total": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The total of the document. Never zero. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "paid": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount received (320, 400). Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "withholding": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Tax withheld at source (400). Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              }
            },
            "required": [
              "subtotal",
              "discount",
              "netBeforeDiscount",
              "discountNet",
              "net",
              "vat",
              "total",
              "paid",
              "withholding"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "docType",
          "issuerVatStatus",
          "issuerProfileVersion",
          "documentDate",
          "priceMode",
          "vatPresentation",
          "customer",
          "lines",
          "vatGroups",
          "payments",
          "paymentDate",
          "paymentNature",
          "reason",
          "badDebt",
          "creditedInvoices",
          "correction",
          "relatedDocuments",
          "deliveryNote",
          "foreignCurrency",
          "buyerDemandedAllocation",
          "notes",
          "expectedPaymentMethods",
          "reverseChargeOf",
          "amounts"
        ],
        "additionalProperties": false
      },
      "Draft": {
        "type": "object",
        "description": "A draft: a computed document that is not issued and has no number [DOC-05, DOC-11].",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The draft. Confirm it by this identifier."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "docType": {
            "type": "integer",
            "enum": [
              300,
              305,
              320,
              330,
              400
            ],
            "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
          },
          "status": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "pending",
              "confirmed",
              "expired",
              "abandoned"
            ],
            "description": "pending: can be confirmed until expiresAt. confirmed: became the document in documentId. expired, abandoned: can never be confirmed."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the draft was stored. ISO 8601, UTC."
          },
          "expiresAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "From this moment the draft cannot be confirmed. ISO 8601, UTC."
          },
          "customerKey": {
            "type": "string",
            "maxLength": 15,
            "description": "The stable key of the customer the document will carry."
          },
          "document": {
            "$ref": "#/components/schemas/PreparedDocument"
          },
          "warnings": {
            "type": "array",
            "description": "Warnings of the rules. A warning does not stop the issue.",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 36,
            "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}$",
            "description": "The document the draft became; null unless status is confirmed."
          }
        },
        "required": [
          "id",
          "issuerId",
          "docType",
          "status",
          "createdAt",
          "expiresAt",
          "customerKey",
          "document",
          "warnings",
          "documentId"
        ],
        "additionalProperties": false
      },
      "Document": {
        "type": "object",
        "description": "An issued document. Final: it is never changed or deleted; a correction is a further document (a credit note, a cancelling receipt, a correcting transaction invoice).",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The document."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "docType": {
            "type": "integer",
            "enum": [
              300,
              305,
              320,
              330,
              400
            ],
            "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
          },
          "number": {
            "type": "integer",
            "description": "The number of the document in its series: consecutive, with no gap."
          },
          "recordNo": {
            "type": "integer",
            "description": "The consecutive number of the record in the permanent file of the business, over all types."
          },
          "documentDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The date printed on the document. \"YYYY-MM-DD\"."
          },
          "producedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "The production moment: the database clock when the document was issued. ISO 8601, UTC."
          },
          "paymentDate": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Payment date. \"YYYY-MM-DD\"."
          },
          "draftId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The draft it was issued from."
          },
          "createdByThisClient": {
            "type": "boolean",
            "description": "Whether the calling client system issued the document."
          },
          "idempotencyKey": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "The Idempotency-Key of the prepare that led to the document; null when another caller issued it."
          },
          "issuer": {
            "type": "object",
            "description": "The business exactly as printed on the document. It never changes when the business details do.",
            "properties": {
              "profileVersion": {
                "type": "integer",
                "description": "The version of the business details the document was issued under."
              },
              "name": {
                "type": "string",
                "maxLength": 200,
                "description": "Name as printed."
              },
              "registrationNumber": {
                "type": "string",
                "maxLength": 9,
                "description": "Dealer number as printed."
              },
              "vatStatus": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "licensed",
                  "exempt"
                ],
                "description": "licensed or exempt."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": "string",
                "maxLength": 100,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "phone": {
                "type": "string",
                "maxLength": 30,
                "description": "Telephone."
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 254,
                "description": "Email."
              }
            },
            "required": [
              "profileVersion",
              "name",
              "registrationNumber",
              "vatStatus",
              "street",
              "houseNumber",
              "city",
              "postalCode",
              "phone",
              "email"
            ],
            "additionalProperties": false
          },
          "customer": {
            "type": "object",
            "description": "The customer exactly as printed.",
            "properties": {
              "key": {
                "type": "string",
                "maxLength": 15,
                "description": "The stable key of the customer."
              },
              "name": {
                "type": "string",
                "maxLength": 200,
                "description": "Name."
              },
              "registrationNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "description": "Dealer or company number."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Country."
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 30,
                "description": "Telephone."
              },
              "countryCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2,
                "description": "Country code."
              }
            },
            "required": [
              "key",
              "name",
              "registrationNumber",
              "street",
              "houseNumber",
              "city",
              "postalCode",
              "country",
              "phone",
              "countryCode"
            ],
            "additionalProperties": false
          },
          "priceMode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "enum": [
              "net",
              "gross",
              null
            ],
            "description": "net or gross; null on a receipt."
          },
          "vatPresentation": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "separate",
              "included",
              "none"
            ],
            "description": "separate: the amount without VAT, the VAT and the total are shown apart. none: the document has no VAT. included: the document shows one total that includes VAT and no VAT amount; only a transaction invoice of a licensed dealer issued before VAT was shown apart on that type holds it, and it keeps showing what it showed."
          },
          "amounts": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Sum of the line amounts. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "discount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Document discount. Decimal text with exactly two decimals, never a JSON number."
              },
              "netBeforeDiscount": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount without VAT before the discount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "discountNet": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The discount without VAT. Decimal text with exactly two decimals, never a JSON number."
              },
              "net": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "vat": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "VAT; \"0.00\" when vatPresentation is none. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "total": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The total of the document. Never zero. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "paid": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount received (320, 400). Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              },
              "withholding": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Tax withheld at source (400). Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              }
            },
            "required": [
              "subtotal",
              "discount",
              "netBeforeDiscount",
              "discountNet",
              "net",
              "vat",
              "total",
              "paid",
              "withholding"
            ],
            "additionalProperties": false
          },
          "foreignCurrency": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "maxLength": 3,
                "description": "Currency code."
              },
              "amount": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Amount in that currency. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
              }
            },
            "required": [
              "code",
              "amount"
            ],
            "additionalProperties": false
          },
          "paymentNature": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "What the payment is for."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Reason of the credit."
          },
          "badDebt": {
            "type": "boolean",
            "description": "Bad-debt credit note."
          },
          "deliveryNote": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "number": {
                "type": "string",
                "maxLength": 50,
                "description": "Number."
              },
              "date": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Date. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "number",
              "date"
            ],
            "additionalProperties": false
          },
          "buyerDemandedAllocation": {
            "type": "boolean",
            "description": "The buyer demanded an allocation number."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Remark."
          },
          "expectedPaymentMethods": {
            "type": [
              "array",
              "null"
            ],
            "description": "On 300 and 305: the means the invoice states it will be paid by [SIG-10]. Null when none was stated.",
            "items": {
              "type": "integer",
              "description": "A means of payment, 2, 3 or 4."
            }
          },
          "reverseChargeOf": {
            "type": [
              "object",
              "null"
            ],
            "description": "On the zero-rate tax invoice of a reverse charge: the invoice the Authority held that it replaces; its rendering prints the two sentences of a reverse charge [ALC-23]. Null on every other document.",
            "properties": {
              "documentId": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The tax invoice it replaces."
              },
              "docType": {
                "type": "integer",
                "enum": [
                  300,
                  305,
                  320,
                  330,
                  400
                ],
                "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
              },
              "number": {
                "type": "integer",
                "description": "Its number."
              },
              "documentDate": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its date. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "documentId",
              "docType",
              "number",
              "documentDate"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineNo": {
                  "type": "integer",
                  "description": "Line number, from 1."
                },
                "description": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Description."
                },
                "itemCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Item code."
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Unit."
                },
                "quantity": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{4}$",
                  "description": "Quantity. Decimal text with exactly four decimals (\"1.0000\"); with a leading minus on a line of a document below zero."
                },
                "unitPrice": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Unit price as entered. Never below zero: the quantity carries the sign of a line. Decimal text with exactly two decimals, never a JSON number."
                },
                "discount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount as entered. Decimal text with exactly two decimals, never a JSON number."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line amount in the price mode of the document. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "unitPriceNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Unit price without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "discountNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line discount without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "netAmount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Line amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "vatKind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard, zero or exempt."
                },
                "vatRate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "The rate of the line; \"0.00\" on zero-rate and exempt lines; null when the document has no VAT. Percent as decimal text (\"18.00\")."
                },
                "baseRefNo": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The entry of refs this line goes against."
                }
              },
              "required": [
                "lineNo",
                "description",
                "itemCode",
                "unit",
                "quantity",
                "unitPrice",
                "discount",
                "amount",
                "unitPriceNet",
                "discountNet",
                "netAmount",
                "vatKind",
                "vatRate",
                "baseRefNo"
              ],
              "additionalProperties": false
            }
          },
          "vatGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "standard",
                    "zero",
                    "exempt"
                  ],
                  "description": "standard, zero or exempt."
                },
                "vatRate": {
                  "type": "string",
                  "maxLength": 10,
                  "description": "The rate of the group. Percent as decimal text (\"18.00\")."
                },
                "subtotal": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Sum of the line amounts. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "discount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Share of the document discount. Decimal text with exactly two decimals, never a JSON number."
                },
                "netBeforeDiscount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount without VAT before the discount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "discountNet": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The discount without VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "net": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount without VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "vat": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "total": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount with VAT. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                }
              },
              "required": [
                "kind",
                "vatRate",
                "subtotal",
                "discount",
                "netBeforeDiscount",
                "discountNet",
                "net",
                "vat",
                "total"
              ],
              "additionalProperties": false
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineNo": {
                  "type": "integer",
                  "description": "Line number, from 1."
                },
                "method": {
                  "type": "integer",
                  "description": "Means of payment, 1 to 9."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Amount. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "bankNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Bank number."
                },
                "branchNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Branch number."
                },
                "accountNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 15,
                  "description": "Account number."
                },
                "chequeNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "description": "Cheque number."
                },
                "dueDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Due date. \"YYYY-MM-DD\"."
                },
                "cardAcquirer": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Card acquirer."
                },
                "cardName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Card name."
                },
                "cardDealType": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Kind of card deal."
                },
                "cardInstallments": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Instalments."
                },
                "cardLast4": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4,
                  "description": "Last four digits."
                },
                "methodDetail": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Detail."
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "Reference."
                },
                "crossedNotNegotiable": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Cheque only: stated crossed, in the customer's name, \"לא סחיר\", to the order of the business only [SIG-10]. Null when not stated."
                }
              },
              "required": [
                "lineNo",
                "method",
                "amount",
                "bankNumber",
                "branchNumber",
                "accountNumber",
                "chequeNumber",
                "dueDate",
                "cardAcquirer",
                "cardName",
                "cardDealType",
                "cardInstallments",
                "cardLast4",
                "methodDetail",
                "reference",
                "crossedNotNegotiable"
              ],
              "additionalProperties": false
            }
          },
          "refs": {
            "type": "array",
            "description": "The documents this one relates to: the invoices of a credit note, the invoice of a receipt, the one document a correcting document corrects.",
            "items": {
              "type": "object",
              "properties": {
                "refNo": {
                  "type": "integer",
                  "description": "Entry number, from 1."
                },
                "documentId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The document referred to."
                },
                "docType": {
                  "type": "integer",
                  "enum": [
                    300,
                    305,
                    320,
                    330,
                    400
                  ],
                  "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
                },
                "number": {
                  "type": "integer",
                  "description": "Its number."
                },
                "documentDate": {
                  "type": "string",
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Its date. \"YYYY-MM-DD\"."
                },
                "amount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The part of this document that goes against it; null when not stated. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "refNo",
                "documentId",
                "docType",
                "number",
                "documentDate",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "correction": {
            "type": [
              "object",
              "null"
            ],
            "description": "The earlier document this one corrects [DOC-56, DOC-73, DOC-75]; null on a document that corrects nothing.",
            "properties": {
              "docType": {
                "type": "integer",
                "enum": [
                  300,
                  320,
                  400
                ],
                "description": "The type of the corrected document: 300, 400, or 320 when a cancelling receipt takes back the payment of a tax invoice / receipt."
              },
              "number": {
                "type": "integer",
                "description": "Its number."
              },
              "documentDate": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its date. \"YYYY-MM-DD\"."
              },
              "documentId": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The corrected document."
              },
              "effect": {
                "type": "string",
                "maxLength": 11,
                "enum": [
                  "cancel",
                  "cancel-part",
                  "credit",
                  "charge"
                ],
                "description": "cancel: a receipt, or the payment of a tax invoice / receipt, taken back in full. cancel-part: a part of it taken back. credit: a transaction invoice reduced. charge: a transaction invoice added to."
              },
              "correctedAmount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "What the corrected document stands at after this one, VAT included: after a cancelling receipt, what is left of the money received on it (\"0.00\" after a cancellation in full; of a 320, of the payment recorded on it); on a correcting transaction invoice, what the corrected invoice stands at after it. Decimal text with exactly two decimals, never a JSON number."
              },
              "onTransaction": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "On a transaction invoice that holds a new transaction and the correction of an earlier one [DOC-76]; null on every other correcting document.",
                "properties": {
                  "transactionNet": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The new transaction without VAT. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "transactionVat": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "Its VAT; \"0.00\" for an exempt dealer. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "transactionAmount": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "The new transaction, VAT included, before the correction: the amount the section writes the correction after, printed as the subtotal \"סה\"כ העסקה החדשה\". The bottom line of the document is its total. Decimal text with exactly two decimals, never a JSON number."
                  },
                  "correctionAmount": {
                    "type": "string",
                    "maxLength": 21,
                    "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                    "description": "\"סכום החיוב או הזיכוי\": what the correction lines change, VAT included; below zero for a credit. transactionAmount plus this is the total of the document, the corrected amount the customer pays. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                  }
                },
                "required": [
                  "transactionNet",
                  "transactionVat",
                  "transactionAmount",
                  "correctionAmount"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "docType",
              "number",
              "documentDate",
              "documentId",
              "effect",
              "correctedAmount",
              "onTransaction"
            ],
            "additionalProperties": false
          },
          "correctedBy": {
            "type": "array",
            "description": "The documents that correct this one, in the order of their numbers: the cancelling receipts of a receipt or of a tax invoice / receipt (one in full, or any number of parts), the correcting invoices of a transaction invoice. Empty for a document nothing corrects.",
            "items": {
              "type": "object",
              "properties": {
                "documentId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The correcting document."
                },
                "docType": {
                  "type": "integer",
                  "enum": [
                    300,
                    400
                  ],
                  "description": "Its type, 300 or 400."
                },
                "effect": {
                  "type": "string",
                  "maxLength": 11,
                  "enum": [
                    "cancel",
                    "cancel-part",
                    "credit",
                    "charge"
                  ],
                  "description": "cancel or cancel-part on a cancelling receipt (in full, in part); credit or charge on a correcting transaction invoice."
                },
                "number": {
                  "type": "integer",
                  "description": "Its number."
                },
                "documentDate": {
                  "type": "string",
                  "maxLength": 10,
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                  "description": "Its date. \"YYYY-MM-DD\"."
                },
                "total": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Its total. On a correcting document that holds only the correction, what it adds to or takes from this document. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "correctionAmount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "On a transaction invoice that also holds a new transaction: what its correction adds to or takes from this document [DOC-76]. Null when its total is that. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                },
                "correctedAmount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "What this document stands at after it. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "documentId",
                "docType",
                "effect",
                "number",
                "documentDate",
                "total",
                "correctionAmount",
                "correctedAmount"
              ],
              "additionalProperties": false
            }
          },
          "files": {
            "type": "array",
            "description": "Every stored rendering, oldest first. The bytes are not part of this answer.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The stored file."
                },
                "role": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "original",
                    "copy",
                    "cancelled"
                  ],
                  "description": "original, copy or cancelled."
                },
                "form": {
                  "type": "string",
                  "maxLength": 12,
                  "enum": [
                    "computerized",
                    "paper"
                  ],
                  "description": "computerized or paper."
                },
                "sha256": {
                  "type": "string",
                  "maxLength": 64,
                  "description": "SHA-256 of the file, hex."
                },
                "sizeBytes": {
                  "type": "integer",
                  "description": "Size in bytes."
                },
                "recordedAt": {
                  "type": "string",
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When it was stored. ISO 8601, UTC."
                },
                "superseded": {
                  "type": "boolean",
                  "description": "True for an original that a later original of the same document replaced before any left the business (an allocation number arrived, or the original was printed for hand-over). It never left the business and is not the original of the document: the original is the latest file with role \"original\", and only that one is ever released. Kept because nothing of the permanent file is deleted."
                }
              },
              "required": [
                "id",
                "role",
                "form",
                "sha256",
                "sizeBytes",
                "recordedAt",
                "superseded"
              ],
              "additionalProperties": false
            }
          },
          "allocationNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "The allocation number, when the document has one."
          },
          "cancelled": {
            "type": "boolean",
            "description": "Whether the document was cancelled."
          },
          "cancelledAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the cancellation was recorded. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "issuerId",
          "docType",
          "number",
          "recordNo",
          "documentDate",
          "producedAt",
          "paymentDate",
          "draftId",
          "createdByThisClient",
          "idempotencyKey",
          "issuer",
          "customer",
          "priceMode",
          "vatPresentation",
          "amounts",
          "foreignCurrency",
          "paymentNature",
          "reason",
          "badDebt",
          "deliveryNote",
          "buyerDemandedAllocation",
          "notes",
          "expectedPaymentMethods",
          "reverseChargeOf",
          "lines",
          "vatGroups",
          "payments",
          "refs",
          "correction",
          "correctedBy",
          "files",
          "allocationNumber",
          "cancelled",
          "cancelledAt"
        ],
        "additionalProperties": false
      },
      "DocumentSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The document."
          },
          "docType": {
            "type": "integer",
            "enum": [
              300,
              305,
              320,
              330,
              400
            ],
            "description": "Document type: 300 transaction invoice, 305 tax invoice, 320 tax invoice-receipt, 330 credit tax invoice, 400 receipt."
          },
          "number": {
            "type": "integer",
            "description": "Number in its series."
          },
          "recordNo": {
            "type": "integer",
            "description": "Record number in the permanent file."
          },
          "documentDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Document date. \"YYYY-MM-DD\"."
          },
          "producedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "Production moment. ISO 8601, UTC."
          },
          "customerKey": {
            "type": "string",
            "maxLength": 15,
            "description": "Customer key."
          },
          "customerName": {
            "type": "string",
            "maxLength": 200,
            "description": "Customer name as printed."
          },
          "total": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Total. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
          },
          "cancelled": {
            "type": "boolean",
            "description": "Whether the document was cancelled."
          }
        },
        "required": [
          "id",
          "docType",
          "number",
          "recordNo",
          "documentDate",
          "producedAt",
          "customerKey",
          "customerName",
          "total",
          "cancelled"
        ],
        "additionalProperties": false
      },
      "Issue": {
        "type": "object",
        "description": "One reason a request was refused, or one warning.",
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 80,
            "description": "The code of the reason. Match on this."
          },
          "requirement": {
            "type": "string",
            "maxLength": 200,
            "description": "The requirement row, iron rule or section behind the check."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Where in the request; null for the document as a whole."
          },
          "details": {
            "type": "object",
            "description": "Values of the reason; amounts are decimal text.",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          }
        },
        "required": [
          "code",
          "requirement",
          "path",
          "details"
        ],
        "additionalProperties": false
      },
      "CreateIssuerRequest": {
        "type": "object",
        "description": "A business to add to the register. It joins as \"invited\" and can issue nothing until its owner activates it.",
        "properties": {
          "profile": {
            "type": "object",
            "description": "The details of the business.",
            "properties": {
              "vatStatus": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "licensed",
                  "exempt"
                ],
                "description": "How the Tax Authority registered the business: licensed (עוסק מורשה) or exempt (עוסק פטור)."
              },
              "legalName": {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "description": "The name printed on every document."
              },
              "registrationNumber": {
                "type": "string",
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "The nine-digit number printed on the documents: the VAT registration number, or for an exempt dealer its dealer or identity number."
              },
              "companyNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "Number at the companies registrar, nine digits."
              },
              "deductionsFileNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "Withholding file number, nine digits."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": "string",
                "maxLength": 100,
                "minLength": 1,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "phone": {
                "type": "string",
                "maxLength": 30,
                "minLength": 1,
                "description": "Telephone of the business."
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 254,
                "description": "Email of the business, printed on its documents."
              },
              "effectiveFrom": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "First day the details apply. Default: today in Israel. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "vatStatus",
              "legalName",
              "registrationNumber",
              "city",
              "phone"
            ],
            "additionalProperties": false
          },
          "owner": {
            "type": "object",
            "description": "The person who will activate the business and grant this client permission.",
            "properties": {
              "email": {
                "type": "string",
                "maxLength": 254,
                "minLength": 3,
                "description": "Email of the business owner, who activates the account."
              },
              "name": {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "description": "Name of the business owner."
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 30,
                "description": "Mobile telephone of the business owner."
              }
            },
            "required": [
              "email",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "profile",
          "owner"
        ],
        "additionalProperties": false
      },
      "Issuer": {
        "type": "object",
        "description": "A business that issues documents.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "status": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "invited",
              "active"
            ],
            "description": "invited: created, cannot issue. active: the owner activated it."
          },
          "granted": {
            "type": "boolean",
            "description": "Whether the business currently lets this client act for it. Issuing needs status active and granted true."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the business was added. ISO 8601, UTC."
          },
          "activatedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the owner activated it. ISO 8601, UTC."
          },
          "profile": {
            "type": "object",
            "properties": {
              "version": {
                "type": "integer",
                "description": "The version of the details shown: the one in force today."
              },
              "effectiveFrom": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "First day this version applies. \"YYYY-MM-DD\"."
              },
              "vatStatus": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "licensed",
                  "exempt"
                ],
                "description": "How the Tax Authority registered the business: licensed (עוסק מורשה) or exempt (עוסק פטור)."
              },
              "legalName": {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "description": "The name printed on every document."
              },
              "registrationNumber": {
                "type": "string",
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "The nine-digit number printed on the documents: the VAT registration number, or for an exempt dealer its dealer or identity number."
              },
              "companyNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "Number at the companies registrar, nine digits."
              },
              "deductionsFileNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 9,
                "pattern": "^[0-9]{9}$",
                "description": "Withholding file number, nine digits."
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "Street."
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "House number."
              },
              "city": {
                "type": "string",
                "maxLength": 100,
                "minLength": 1,
                "description": "City."
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20,
                "description": "Postal code."
              },
              "phone": {
                "type": "string",
                "maxLength": 30,
                "minLength": 1,
                "description": "Telephone of the business."
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 254,
                "description": "Email of the business, printed on its documents."
              }
            },
            "required": [
              "version",
              "effectiveFrom",
              "vatStatus",
              "legalName",
              "registrationNumber",
              "companyNumber",
              "deductionsFileNumber",
              "street",
              "houseNumber",
              "city",
              "postalCode",
              "phone",
              "email"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "status",
          "granted",
          "createdAt",
          "activatedAt",
          "profile"
        ],
        "additionalProperties": false
      },
      "Customer": {
        "type": "object",
        "description": "A customer of a business. A document carries its own copy of the details as printed.",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 15,
            "description": "The stable key of the customer [UNI-27]."
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name."
          },
          "registrationNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 9,
            "description": "Dealer or company number."
          },
          "isLicensedDealer": {
            "type": "boolean",
            "description": "The customer is an עוסק מורשה."
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Street."
          },
          "houseNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "House number."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City."
          },
          "postalCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Postal code."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Country."
          },
          "countryCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2,
            "description": "Country code."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Telephone."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "description": "Email."
          },
          "externalRef": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "The identifier in the caller's own system; null when another caller created the customer."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the customer was created. ISO 8601, UTC."
          },
          "updatedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the record last changed. ISO 8601, UTC."
          }
        },
        "required": [
          "key",
          "name",
          "registrationNumber",
          "isLicensedDealer",
          "street",
          "houseNumber",
          "city",
          "postalCode",
          "country",
          "countryCode",
          "phone",
          "email",
          "externalRef",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "UniformExport": {
        "type": "object",
        "description": "One production of the uniform-structure files (\"ממשק פתוח\") of a business.",
        "properties": {
          "exportId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The stored production."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "from": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "First document date of the range. \"YYYY-MM-DD\"."
          },
          "to": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Last document date of the range. \"YYYY-MM-DD\"."
          },
          "producedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "The production moment the files state. ISO 8601, UTC."
          },
          "storedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the production was stored. ISO 8601, UTC."
          },
          "primaryId": {
            "type": "string",
            "maxLength": 15,
            "description": "The primary identifier of the production, 15 digits."
          },
          "directory": {
            "type": "string",
            "maxLength": 40,
            "description": "The directory of the production, \"OPENFRMT/<8 digits>.<YY>/<MMDDhhmm>\"."
          },
          "encoding": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "windows-1255",
              "cp862"
            ],
            "description": "Character set of both files."
          },
          "dealerNumber": {
            "type": "string",
            "maxLength": 9,
            "description": "The dealer number every record carries."
          },
          "softwareRegistrationNumber": {
            "type": "string",
            "maxLength": 8,
            "description": "Registration number of the software as written to the file."
          },
          "softwareEdition": {
            "type": "string",
            "maxLength": 20,
            "description": "Edition as written to the file."
          },
          "recordCount": {
            "type": "integer",
            "description": "Records in BKMVDATA.TXT."
          },
          "documentCount": {
            "type": "integer",
            "description": "Documents in the file."
          },
          "empty": {
            "type": "boolean",
            "description": "True when the range held no document."
          },
          "counts": {
            "type": "object",
            "description": "Number of records per record code, and \"total\".",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "sha256": {
            "type": "object",
            "properties": {
              "ini": {
                "type": "string",
                "maxLength": 64,
                "description": "SHA-256 of INI.TXT, hex."
              },
              "bkmvdata": {
                "type": "string",
                "maxLength": 64,
                "description": "SHA-256 of BKMVDATA.TXT, hex."
              },
              "bkmvdataArchive": {
                "type": "string",
                "maxLength": 64,
                "description": "SHA-256 of BKMVDATA.zip, hex."
              }
            },
            "required": [
              "ini",
              "bkmvdata",
              "bkmvdataArchive"
            ],
            "additionalProperties": false
          },
          "sizeBytes": {
            "type": "object",
            "properties": {
              "ini": {
                "type": "integer",
                "description": "INI.TXT."
              },
              "bkmvdata": {
                "type": "integer",
                "description": "BKMVDATA.TXT, uncompressed."
              },
              "bkmvdataArchive": {
                "type": "integer",
                "description": "BKMVDATA.zip."
              }
            },
            "required": [
              "ini",
              "bkmvdata",
              "bkmvdataArchive"
            ],
            "additionalProperties": false
          },
          "textNotes": {
            "type": "array",
            "description": "Every text that was altered or cut on its way into a field of the files.",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "Record and field, for example \"C100.1207\"."
                },
                "recordNumber": {
                  "type": "integer",
                  "description": "Running number of the record in its file; 0 for INI.TXT."
                },
                "changes": {
                  "type": "array",
                  "description": "Characters the character set of the file does not hold.",
                  "items": {
                    "type": "object",
                    "description": "One character that was replaced or dropped.",
                    "additionalProperties": true
                  }
                },
                "cutFrom": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Length before the cut, when the text was longer than its field."
                }
              },
              "required": [
                "field",
                "recordNumber",
                "changes",
                "cutFrom"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "exportId",
          "issuerId",
          "from",
          "to",
          "producedAt",
          "storedAt",
          "primaryId",
          "directory",
          "encoding",
          "dealerNumber",
          "softwareRegistrationNumber",
          "softwareEdition",
          "recordCount",
          "documentCount",
          "empty",
          "counts",
          "sha256",
          "sizeBytes",
          "textNotes"
        ],
        "additionalProperties": false
      },
      "Link": {
        "type": "object",
        "description": "A personal link through which the recipient of one document opens the page of the issuing business and downloads the document.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The link. The token is not part of it and cannot be read back."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "documentId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The one document the link is for."
          },
          "recipientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Whom the link was made for, as its maker named them."
          },
          "recipientAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "Where the link was meant to go, as its maker stated it."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the link was made. ISO 8601, UTC."
          },
          "expiresAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "From this moment the link answers like a link that never existed. ISO 8601, UTC."
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the link was revoked. ISO 8601, UTC."
          },
          "state": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "active",
              "expired",
              "revoked"
            ],
            "description": "active, expired or revoked."
          }
        },
        "required": [
          "id",
          "issuerId",
          "documentId",
          "recipientName",
          "recipientAddress",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "state"
        ],
        "additionalProperties": false
      },
      "Consent": {
        "type": "object",
        "description": "A consent of a customer to receive computerized documents of a business, or its withdrawal [SIG-11 to SIG-14]. Records are never changed; the last one decides.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The record."
          },
          "kind": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "given",
              "withdrawn"
            ],
            "description": "given or withdrawn."
          },
          "method": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "recipient_page",
              "client_report",
              "business_record"
            ],
            "description": "recipient_page: on the page of a link. client_report: reported by a client system. business_record: recorded by the business."
          },
          "customerKey": {
            "type": "string",
            "maxLength": 15,
            "description": "The customer."
          },
          "wording": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000,
            "description": "The exact words the recipient agreed to, or withdrew with."
          },
          "recipientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The recipient as named."
          },
          "recipientAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "The address the consent was about."
          },
          "occurredAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the recipient consented or withdrew, as known. ISO 8601, UTC."
          },
          "recordedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the record was written. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "kind",
          "method",
          "customerKey",
          "wording",
          "recipientName",
          "recipientAddress",
          "occurredAt",
          "recordedAt"
        ],
        "additionalProperties": false
      },
      "ConsentState": {
        "type": "object",
        "description": "Whether a consent of the customer toward the business stands, and every record that led there.",
        "properties": {
          "standing": {
            "type": [
              "object",
              "null"
            ],
            "description": "A consent of a customer to receive computerized documents of a business, or its withdrawal [SIG-11 to SIG-14]. Records are never changed; the last one decides.",
            "properties": {
              "id": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The record."
              },
              "kind": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "given",
                  "withdrawn"
                ],
                "description": "given or withdrawn."
              },
              "method": {
                "type": "string",
                "maxLength": 20,
                "enum": [
                  "recipient_page",
                  "client_report",
                  "business_record"
                ],
                "description": "recipient_page: on the page of a link. client_report: reported by a client system. business_record: recorded by the business."
              },
              "customerKey": {
                "type": "string",
                "maxLength": 15,
                "description": "The customer."
              },
              "wording": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000,
                "description": "The exact words the recipient agreed to, or withdrew with."
              },
              "recipientName": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 200,
                "description": "The recipient as named."
              },
              "recipientAddress": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 320,
                "description": "The address the consent was about."
              },
              "occurredAt": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "When the recipient consented or withdrew, as known. ISO 8601, UTC."
              },
              "recordedAt": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "When the record was written. ISO 8601, UTC."
              }
            },
            "required": [
              "id",
              "kind",
              "method",
              "customerKey",
              "wording",
              "recipientName",
              "recipientAddress",
              "occurredAt",
              "recordedAt"
            ],
            "additionalProperties": false
          },
          "withdrawn": {
            "type": "boolean",
            "description": "True when the last record is a withdrawal: nothing is sent to this customer."
          },
          "history": {
            "type": "array",
            "description": "Every record of this business and customer, oldest first.",
            "items": {
              "$ref": "#/components/schemas/Consent"
            }
          }
        },
        "required": [
          "standing",
          "withdrawn",
          "history"
        ],
        "additionalProperties": false
      },
      "DeliveryRecord": {
        "type": "object",
        "description": "Everything that happened to a document after it was issued [SIG-17].",
        "properties": {
          "documentId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The document."
          },
          "release": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "deliveryId": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The hand-over that carried the original."
              },
              "channel": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "link",
                  "print"
                ],
                "description": "link: downloaded by the recipient. print: printed for hand-over on paper."
              },
              "releasedAt": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "When the original left the business. ISO 8601, UTC."
              }
            },
            "required": [
              "deliveryId",
              "channel",
              "releasedAt"
            ],
            "additionalProperties": false
          },
          "cancelledAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the document was cancelled. ISO 8601, UTC."
          },
          "links": {
            "type": "array",
            "description": "Every link made for the document, oldest first. Never a token.",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "messages": {
            "type": "array",
            "description": "Every message by which the product itself sent a link.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The request of the sending."
                },
                "linkId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The link the message carried."
                },
                "channel": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "email",
                    "sms",
                    "whatsapp"
                  ],
                  "description": "How the message travelled."
                },
                "recipientAddress": {
                  "type": "string",
                  "maxLength": 320,
                  "description": "The address it was sent to."
                },
                "templateVersion": {
                  "type": "string",
                  "maxLength": 40,
                  "description": "The version of the fixed wording of the message."
                },
                "outcome": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "sent",
                    "failed",
                    "unknown"
                  ],
                  "description": "sent: the mail service took it. failed: it did not. unknown: no answer came; nothing is assumed."
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 64,
                  "description": "Short name of why a sending failed."
                },
                "requestedAt": {
                  "type": "string",
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When the sending was asked for. ISO 8601, UTC."
                }
              },
              "required": [
                "id",
                "linkId",
                "channel",
                "recipientAddress",
                "templateVersion",
                "outcome",
                "reason",
                "requestedAt"
              ],
              "additionalProperties": false
            }
          },
          "deliveries": {
            "type": "array",
            "description": "Every file of the document that was handed out, to whom and how.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The hand-over."
                },
                "fileId": {
                  "type": "string",
                  "maxLength": 36,
                  "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}$",
                  "description": "The stored file that was handed out."
                },
                "role": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "original",
                    "copy",
                    "cancelled"
                  ],
                  "description": "original, copy or cancelled."
                },
                "form": {
                  "type": "string",
                  "maxLength": 12,
                  "enum": [
                    "computerized",
                    "paper"
                  ],
                  "description": "computerized or paper."
                },
                "channel": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "link",
                    "print",
                    "business"
                  ],
                  "description": "link, print or business."
                },
                "linkId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 36,
                  "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}$",
                  "description": "The link a download came through."
                },
                "consentId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 36,
                  "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}$",
                  "description": "The consent a download rested on."
                },
                "recipientName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 200,
                  "description": "To whom."
                },
                "recipientAddress": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 320,
                  "description": "The address of the recipient, when known."
                },
                "recordedAt": {
                  "type": "string",
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When the file was handed out. ISO 8601, UTC."
                }
              },
              "required": [
                "id",
                "fileId",
                "role",
                "form",
                "channel",
                "linkId",
                "consentId",
                "recipientName",
                "recipientAddress",
                "recordedAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "documentId",
          "release",
          "cancelledAt",
          "links",
          "messages",
          "deliveries"
        ],
        "additionalProperties": false
      },
      "CreateLinkRequest": {
        "type": "object",
        "description": "For whom the link is, and whether the product should also send it.",
        "properties": {
          "recipientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Whom the link is for. Default: the customer as printed on the document."
          },
          "recipientAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "Where the link is meant to go, as the business knows it (an email address, a telephone). Kept as a record."
          },
          "ttlSeconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 60,
            "maximum": 31622400,
            "description": "How long the link lives, in seconds: 60 to 31622400. Default: the setting of the deployment (30 days)."
          },
          "sendEmailTo": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "description": "Send the link by email to this address, in the name of the business. Needs a deployment that sends email."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "EmailOutcome": {
        "type": "object",
        "description": "What became of the email of a link.",
        "properties": {
          "sent": {
            "type": "boolean",
            "description": "True when the mail service took the message."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "description": "The address the message was sent to."
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The identifier the mail service gave the message."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 60,
            "description": "When sent is false: the code of the reason (MAIL_FAILED, MAIL_OUTCOME_UNKNOWN, CONSENT_WITHDRAWN, ...)."
          }
        },
        "required": [
          "sent",
          "to",
          "messageId",
          "code"
        ],
        "additionalProperties": false
      },
      "ReportConsentRequest": {
        "type": "object",
        "description": "A consent the client system collected itself [SIG-12].",
        "properties": {
          "wording": {
            "type": "string",
            "maxLength": 4000,
            "minLength": 1,
            "description": "The exact words the recipient agreed to."
          },
          "evidence": {
            "type": "object",
            "description": "What proves the consent: the screen, the address used, the client system's own record. Up to 16 KB as JSON.",
            "maxProperties": 50
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the recipient consented. Default: now. Never in the future. ISO 8601, UTC."
          },
          "recipientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The recipient as named."
          },
          "recipientAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "The address the consent is about."
          }
        },
        "required": [
          "wording",
          "evidence"
        ],
        "additionalProperties": false
      },
      "WithdrawConsentRequest": {
        "type": "object",
        "description": "A withdrawal the client system received [SIG-14]. Every key is optional.",
        "properties": {
          "evidence": {
            "type": "object",
            "description": "What proves the consent: the screen, the address used, the client system's own record. Up to 16 KB as JSON.",
            "maxProperties": 50
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the recipient withdrew. Default: now. Never in the future. ISO 8601, UTC."
          },
          "recipientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The recipient as named."
          },
          "recipientAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "The address the withdrawal is about."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "CancelRequest": {
        "type": "object",
        "description": "A cancellation and the statement it rests on.",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "description": "Why the document is cancelled, in the words of the business."
          },
          "declaredUnreported": {
            "type": "boolean",
            "description": "The statement of the business that the document was not yet reported in a periodic VAT report [DOC-54]. Send true only when the business itself said so; never fill it in."
          }
        },
        "required": [
          "reason",
          "declaredUnreported"
        ],
        "additionalProperties": false
      },
      "TransmissionState": {
        "type": "object",
        "description": "Where the transmission of one stored production to the Tax Authority stands. Read from what was recorded; reading it asks the Authority nothing.",
        "properties": {
          "exportId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The stored production."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "status": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "not-sent",
              "incomplete",
              "uploaded",
              "approved",
              "rejected",
              "no-requirement",
              "refused",
              "failed"
            ],
            "description": "not-sent: nothing was ever sent. incomplete: the latest attempt has its links and not yet both files. uploaded: both files are with the Authority, not yet decided. approved. rejected: the Authority rejected a file; reasons says why. no-requirement: the Authority asks no file of this business for this period. refused: the Authority refused a request. failed: a fault of the Authority, or no answer."
          },
          "next": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "send",
              "resume",
              "check-status",
              "sign-in",
              "none"
            ],
            "description": "What to do next: send, resume or check-status (all three are the same POST), sign-in (the owner signs in at the Authority, in the portal), or none."
          },
          "attempts": {
            "type": "integer",
            "description": "How many times the production was sent."
          },
          "remoteSetId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The identifier the Authority gave the latest set of links."
          },
          "files": {
            "type": "object",
            "properties": {
              "ini": {
                "type": "object",
                "properties": {
                  "uploaded": {
                    "type": "boolean",
                    "description": "True when the whole content was accepted by the upload service in the latest attempt."
                  },
                  "remoteFileId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "The identifier the Authority gave the file."
                  },
                  "remoteFileName": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "The name the Authority gave the file."
                  },
                  "sentBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Bytes sent."
                  },
                  "sentSha256": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 64,
                    "description": "SHA-256 of what was sent, hex."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 100,
                    "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "The reason of a rejection, as received."
                  },
                  "uploadedDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40,
                    "description": "The upload date of the status answer, as received."
                  },
                  "updatedDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40,
                    "description": "The update date of the status answer, as received."
                  },
                  "statusCheckedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When the status was last asked. ISO 8601, UTC."
                  }
                },
                "required": [
                  "uploaded",
                  "remoteFileId",
                  "remoteFileName",
                  "sentBytes",
                  "sentSha256",
                  "status",
                  "description",
                  "uploadedDate",
                  "updatedDate",
                  "statusCheckedAt"
                ],
                "additionalProperties": false
              },
              "bkm": {
                "type": "object",
                "properties": {
                  "uploaded": {
                    "type": "boolean",
                    "description": "True when the whole content was accepted by the upload service in the latest attempt."
                  },
                  "remoteFileId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "The identifier the Authority gave the file."
                  },
                  "remoteFileName": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "The name the Authority gave the file."
                  },
                  "sentBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Bytes sent."
                  },
                  "sentSha256": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 64,
                    "description": "SHA-256 of what was sent, hex."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 100,
                    "description": "The latest status value, as the Authority returned it: Uploaded, Approved, Rejected."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "The reason of a rejection, as received."
                  },
                  "uploadedDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40,
                    "description": "The upload date of the status answer, as received."
                  },
                  "updatedDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40,
                    "description": "The update date of the status answer, as received."
                  },
                  "statusCheckedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 30,
                    "format": "date-time",
                    "description": "When the status was last asked. ISO 8601, UTC."
                  }
                },
                "required": [
                  "uploaded",
                  "remoteFileId",
                  "remoteFileName",
                  "sentBytes",
                  "sentSha256",
                  "status",
                  "description",
                  "uploadedDate",
                  "updatedDate",
                  "statusCheckedAt"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "ini",
              "bkm"
            ],
            "additionalProperties": false
          },
          "reasons": {
            "type": "array",
            "description": "What the Authority said about the latest refusal or rejection [TRX-18].",
            "items": {
              "type": "string",
              "maxLength": 4000,
              "description": "The words of the Authority, as received."
            }
          },
          "lastProblem": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "seq": {
                "type": "integer",
                "description": "Order of the recorded steps."
              },
              "attempt": {
                "type": "integer",
                "description": "The attempt the step belongs to, from 1."
              },
              "step": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "links",
                  "start",
                  "upload",
                  "status"
                ],
                "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
              },
              "file": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 3,
                "enum": [
                  "ini",
                  "bkm",
                  null
                ],
                "description": "ini or bkm; null on the links step."
              },
              "outcome": {
                "type": "string",
                "maxLength": 10,
                "enum": [
                  "ok",
                  "refused",
                  "failed",
                  "unknown"
                ],
                "description": "ok, refused, failed or unknown."
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 64,
                "description": "Short name of what happened when the step did not end ok."
              },
              "httpStatus": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The HTTP status of the answer."
              },
              "fileStatus": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "The status value, on a status step."
              },
              "said": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000,
                "description": "What the Authority said, word for word, when the step did not end well."
              },
              "sentAt": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 30,
                "format": "date-time",
                "description": "When the request left. ISO 8601, UTC."
              },
              "recordedAt": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "When the step was recorded. ISO 8601, UTC."
              }
            },
            "required": [
              "seq",
              "attempt",
              "step",
              "file",
              "outcome",
              "reason",
              "httpStatus",
              "fileStatus",
              "said",
              "sentAt",
              "recordedAt"
            ],
            "additionalProperties": false
          },
          "steps": {
            "type": "array",
            "description": "Every recorded request and its answer, in order.",
            "items": {
              "type": "object",
              "properties": {
                "seq": {
                  "type": "integer",
                  "description": "Order of the recorded steps."
                },
                "attempt": {
                  "type": "integer",
                  "description": "The attempt the step belongs to, from 1."
                },
                "step": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "links",
                    "start",
                    "upload",
                    "status"
                  ],
                  "description": "links: the upload links were asked for. start, upload: a file was sent. status: the status service was asked."
                },
                "file": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 3,
                  "enum": [
                    "ini",
                    "bkm",
                    null
                  ],
                  "description": "ini or bkm; null on the links step."
                },
                "outcome": {
                  "type": "string",
                  "maxLength": 10,
                  "enum": [
                    "ok",
                    "refused",
                    "failed",
                    "unknown"
                  ],
                  "description": "ok, refused, failed or unknown."
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 64,
                  "description": "Short name of what happened when the step did not end ok."
                },
                "httpStatus": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The HTTP status of the answer."
                },
                "fileStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 100,
                  "description": "The status value, on a status step."
                },
                "said": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4000,
                  "description": "What the Authority said, word for word, when the step did not end well."
                },
                "sentAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When the request left. ISO 8601, UTC."
                },
                "recordedAt": {
                  "type": "string",
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When the step was recorded. ISO 8601, UTC."
                }
              },
              "required": [
                "seq",
                "attempt",
                "step",
                "file",
                "outcome",
                "reason",
                "httpStatus",
                "fileStatus",
                "said",
                "sentAt",
                "recordedAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "exportId",
          "issuerId",
          "status",
          "next",
          "attempts",
          "remoteSetId",
          "files",
          "reasons",
          "lastProblem",
          "steps"
        ],
        "additionalProperties": false
      },
      "AuthorityConnection": {
        "type": "object",
        "description": "The connection of a business to the Tax Authority. It never holds a token, and a client system never receives one [SEC-04].",
        "properties": {
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "status": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "not-connected",
              "connected",
              "sign-in-required",
              "disconnected"
            ],
            "description": "not-connected: the owner never signed in. connected. sign-in-required: the owner must sign in again. disconnected: the business ended the connection."
          },
          "environment": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "sandbox",
              "production"
            ],
            "description": "The environment of the Authority this deployment talks to."
          },
          "connectedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the owner signed in. ISO 8601, UTC."
          },
          "permissionEndsAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "The end date of the permission of the business, fixed at the sign-in. ISO 8601, UTC."
          },
          "refreshTokenExpiresAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "Until when the connection can be renewed without a new sign-in. ISO 8601, UTC."
          },
          "signInNeededBy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "The earlier of the two: the owner should sign in again before it. ISO 8601, UTC."
          },
          "refreshedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the connection was last renewed. ISO 8601, UTC."
          },
          "remindedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the business was reminded to sign in again. ISO 8601, UTC."
          },
          "endedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When the last connection ended. ISO 8601, UTC."
          },
          "endedReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "Short name of why it ended."
          }
        },
        "required": [
          "issuerId",
          "status",
          "environment",
          "connectedAt",
          "permissionEndsAt",
          "refreshTokenExpiresAt",
          "signInNeededBy",
          "refreshedAt",
          "remindedAt",
          "endedAt",
          "endedReason"
        ],
        "additionalProperties": false
      },
      "DocumentsReport": {
        "type": "object",
        "description": "The report of section 2.6 of the uniform-structure specification: documents per type in a date range.",
        "properties": {
          "softwareName": {
            "type": "string",
            "maxLength": 20,
            "description": "Registered name of the software."
          },
          "softwareRegistrationNumber": {
            "type": "string",
            "maxLength": 8,
            "description": "Its registration number."
          },
          "productionDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Production day in Israel. \"YYYY-MM-DD\"."
          },
          "productionTime": {
            "type": "string",
            "maxLength": 4,
            "description": "Production time in Israel, \"hhmm\"."
          },
          "dealerNumber": {
            "type": "string",
            "maxLength": 9,
            "description": "Dealer number."
          },
          "businessName": {
            "type": "string",
            "maxLength": 200,
            "description": "Business name."
          },
          "from": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "First document date. \"YYYY-MM-DD\"."
          },
          "to": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Last document date. \"YYYY-MM-DD\"."
          },
          "rows": {
            "type": "array",
            "description": "One row per document type of the specification, a zero where the business has none.",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "description": "Document type code."
                },
                "name": {
                  "type": "string",
                  "maxLength": 100,
                  "description": "Its name."
                },
                "count": {
                  "type": "integer",
                  "description": "Documents."
                },
                "total": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Sum of their totals. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
                }
              },
              "required": [
                "code",
                "name",
                "count",
                "total"
              ],
              "additionalProperties": false
            }
          },
          "totalCount": {
            "type": "integer",
            "description": "Documents in the range."
          },
          "totalAmount": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Sum of the totals. Decimal text with exactly two decimals, never a JSON number. Below zero, with a leading minus, only on a cancelling receipt (in full or in part) and on a correcting transaction invoice that credits."
          },
          "cancelledCount": {
            "type": "integer",
            "description": "Cancelled documents among them."
          },
          "cancelledAmount": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Sum of their totals. Decimal text with exactly two decimals, never a JSON number."
          }
        },
        "required": [
          "softwareName",
          "softwareRegistrationNumber",
          "productionDate",
          "productionTime",
          "dealerNumber",
          "businessName",
          "from",
          "to",
          "rows",
          "totalCount",
          "totalAmount",
          "cancelledCount",
          "cancelledAmount"
        ],
        "additionalProperties": false
      },
      "EndOfProcessReport": {
        "type": "object",
        "description": "The report of section 5.4 of the specification, shown when a production ends.",
        "properties": {
          "softwareName": {
            "type": "string",
            "maxLength": 20,
            "description": "Registered name of the software."
          },
          "softwareRegistrationNumber": {
            "type": "string",
            "maxLength": 8,
            "description": "Its registration number."
          },
          "productionDate": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Production day in Israel. \"YYYY-MM-DD\"."
          },
          "productionTime": {
            "type": "string",
            "maxLength": 4,
            "description": "Production time in Israel, \"hhmm\"."
          },
          "dealerNumber": {
            "type": "string",
            "maxLength": 9,
            "description": "Dealer number."
          },
          "businessName": {
            "type": "string",
            "maxLength": 200,
            "description": "Business name."
          },
          "successText": {
            "type": "string",
            "maxLength": 100,
            "description": "The fixed text of the specification."
          },
          "savePath": {
            "type": "string",
            "maxLength": 60,
            "description": "Where the files were saved."
          },
          "from": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "First document date. \"YYYY-MM-DD\"."
          },
          "to": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Last document date. \"YYYY-MM-DD\"."
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "maxLength": 4,
                  "description": "Record code."
                },
                "description": {
                  "type": "string",
                  "maxLength": 100,
                  "description": "Its description."
                },
                "count": {
                  "type": "integer",
                  "description": "Records."
                }
              },
              "required": [
                "code",
                "description",
                "count"
              ],
              "additionalProperties": false
            }
          },
          "totalRecords": {
            "type": "integer",
            "description": "Records in BKMVDATA.TXT."
          }
        },
        "required": [
          "softwareName",
          "softwareRegistrationNumber",
          "productionDate",
          "productionTime",
          "dealerNumber",
          "businessName",
          "successText",
          "savePath",
          "from",
          "to",
          "rows",
          "totalRecords"
        ],
        "additionalProperties": false
      },
      "Reference": {
        "type": "object",
        "description": "The dated values in force today. Null when none is in force yet.",
        "properties": {
          "today": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "Today in Israel. \"YYYY-MM-DD\"."
          },
          "vatRate": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rate": {
                "type": "string",
                "maxLength": 10,
                "description": "The standard VAT rate in force today. Percent as decimal text (\"18.00\")."
              },
              "validFrom": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its first day. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "rate",
              "validFrom"
            ],
            "additionalProperties": false
          },
          "allocationThreshold": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The amount without VAT above which a tax invoice needs an allocation number when the buyer demands one. Decimal text with exactly two decimals, never a JSON number."
              },
              "validFrom": {
                "type": "string",
                "maxLength": 10,
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "description": "Its first day. \"YYYY-MM-DD\"."
              }
            },
            "required": [
              "amount",
              "validFrom"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "today",
          "vatRate",
          "allocationThreshold"
        ],
        "additionalProperties": false
      },
      "WebhookEndpoint": {
        "type": "object",
        "description": "An address of your system that the service posts signed notices to.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The address."
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Where the notices are posted."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own words for it."
          },
          "eventTypes": {
            "type": "array",
            "maxItems": 15,
            "description": "The kinds of events the address takes: [\"*\"] for every kind (the default), or a list of kinds.",
            "items": {
              "type": "string",
              "maxLength": 40,
              "enum": [
                "*",
                "document.issued",
                "document.cancelled",
                "draft.confirmed",
                "draft.expired",
                "delivery.opened",
                "delivery.downloaded",
                "consent.changed",
                "allocation.received",
                "allocation.held",
                "allocation.failed",
                "transmission.status_changed",
                "transmission.failed",
                "issuer.activated",
                "issuer.granted",
                "issuer.revoked"
              ],
              "description": "A kind of event, or \"*\" alone for every kind."
            }
          },
          "status": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "enabled",
              "disabled",
              "deleted"
            ],
            "description": "\"enabled\": notices are posted. \"disabled\": nothing is posted (see disabledReason); what waited was dropped. \"deleted\": for good."
          },
          "disabledReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "enum": [
              "client",
              "failing",
              null
            ],
            "description": "\"client\": you switched it off. \"failing\": the service switched it off after three days without one successful delivery."
          },
          "disabledAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was switched off. ISO 8601, UTC."
          },
          "lastSuccessAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "The last notice it answered with 2xx. ISO 8601, UTC."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was registered. ISO 8601, UTC."
          },
          "updatedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When it last changed. ISO 8601, UTC."
          },
          "secrets": {
            "type": "array",
            "maxItems": 10,
            "description": "The secrets that sign notices now, newest first. During a rotation, two.",
            "items": {
              "type": "object",
              "description": "A secret of the address that signs notices now. Its value is shown once, when it is made, and never again.",
              "properties": {
                "createdAt": {
                  "type": "string",
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When the secret was made. ISO 8601, UTC."
                },
                "expiresAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 30,
                  "format": "date-time",
                  "description": "When it stops signing; null while it signs with no end. ISO 8601, UTC."
                }
              },
              "required": [
                "createdAt",
                "expiresAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "eventTypes",
          "status",
          "disabledReason",
          "disabledAt",
          "lastSuccessAt",
          "createdAt",
          "updatedAt",
          "secrets"
        ],
        "additionalProperties": false
      },
      "WebhookEvent": {
        "type": "object",
        "description": "An event: what happened, when, to which business, and identifiers. Never a document, an amount, a name or an address.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The event."
          },
          "object": {
            "type": "string",
            "maxLength": 5,
            "enum": [
              "event"
            ],
            "description": "Always \"event\"."
          },
          "type": {
            "type": "string",
            "maxLength": 40,
            "enum": [
              "document.issued",
              "document.cancelled",
              "draft.confirmed",
              "draft.expired",
              "delivery.opened",
              "delivery.downloaded",
              "consent.changed",
              "allocation.received",
              "allocation.held",
              "allocation.failed",
              "transmission.status_changed",
              "transmission.failed",
              "issuer.activated",
              "issuer.granted",
              "issuer.revoked"
            ],
            "description": "The kind of the event."
          },
          "created": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When it happened, by the clock of the database. ISO 8601, UTC."
          },
          "issuerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The business."
          },
          "data": {
            "type": "object",
            "description": "The identifiers of the event, as its kind names them (see the webhooks section of this file).",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "created",
          "issuerId",
          "data"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "description": "Where the sending of one event to one address stands.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The delivery: one event to one address."
          },
          "endpointId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The address."
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "status": {
            "type": "string",
            "maxLength": 10,
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "failed",
              "dropped"
            ],
            "description": "\"pending\": waits for nextAttemptAt. \"sending\": being sent now. \"succeeded\". \"failed\": three days of tries, or the one try you asked for, did not succeed. \"dropped\": never sent (droppedReason)."
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "Tries made."
          },
          "nextAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it is tried next. ISO 8601, UTC."
          },
          "lastAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was tried last. ISO 8601, UTC."
          },
          "lastHttpStatus": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The status of the last answer."
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Why the last try failed, one fixed word."
          },
          "droppedReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "endpoint-disabled, endpoint-deleted, grant-withdrawn, client-revoked."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the event was committed. ISO 8601, UTC."
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it succeeded, failed or was dropped. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "endpointId",
          "event",
          "status",
          "attempts",
          "nextAttemptAt",
          "lastAttemptAt",
          "lastHttpStatus",
          "lastError",
          "droppedReason",
          "createdAt",
          "finishedAt"
        ],
        "additionalProperties": false
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "description": "A new webhook address.",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Where to post the notices: https, a public host name or address, port 443 or 8443 unless the deployment allows others. No user or password, no fragment."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own words for it, 1 to 200 characters."
          },
          "eventTypes": {
            "type": "array",
            "maxItems": 15,
            "description": "The kinds of events the address takes: [\"*\"] for every kind (the default), or a list of kinds.",
            "items": {
              "type": "string",
              "maxLength": 40,
              "enum": [
                "*",
                "document.issued",
                "document.cancelled",
                "draft.confirmed",
                "draft.expired",
                "delivery.opened",
                "delivery.downloaded",
                "consent.changed",
                "allocation.received",
                "allocation.held",
                "allocation.failed",
                "transmission.status_changed",
                "transmission.failed",
                "issuer.activated",
                "issuer.granted",
                "issuer.revoked"
              ],
              "description": "A kind of event, or \"*\" alone for every kind."
            }
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "description": "What to change; what is left out stays.",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "A new address, under the same rules as at registration."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own words for it; null removes them."
          },
          "eventTypes": {
            "type": "array",
            "maxItems": 15,
            "description": "The kinds of events the address takes: [\"*\"] for every kind (the default), or a list of kinds.",
            "items": {
              "type": "string",
              "maxLength": 40,
              "enum": [
                "*",
                "document.issued",
                "document.cancelled",
                "draft.confirmed",
                "draft.expired",
                "delivery.opened",
                "delivery.downloaded",
                "consent.changed",
                "allocation.received",
                "allocation.held",
                "allocation.failed",
                "transmission.status_changed",
                "transmission.failed",
                "issuer.activated",
                "issuer.granted",
                "issuer.revoked"
              ],
              "description": "A kind of event, or \"*\" alone for every kind."
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "false switches the address off (what waited for it is dropped); true switches it on again, also after the service switched it off."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "FinanceYear": {
        "type": "object",
        "description": "The year of a business as the portal's screen \"כספים\" shows it. Income is counted on the money received, document by document, by the rules of src/finance (DECISIONS 2026-11-22): a 320 on its date; a receipt on its date with the tax withheld from it; a 305 on its date while no receipt is linked to it; a credit note by its part against a 320 or a 305 counted by itself; a transaction invoice never; a cancelled document nowhere.",
        "properties": {
          "year": {
            "type": "string",
            "maxLength": 4,
            "pattern": "^20[0-9]{2}$",
            "description": "The year, \"YYYY\": by the date of each document and of each expense, a day in Israel."
          },
          "dealer": {
            "type": "string",
            "maxLength": 8,
            "enum": [
              "licensed",
              "exempt"
            ],
            "description": "licensed: a licensed dealer, whose figures count before VAT. exempt: an exempt dealer, whose figures count as paid."
          },
          "basis": {
            "type": "string",
            "maxLength": 5,
            "enum": [
              "net",
              "total"
            ],
            "description": "Which of the three sums \"profit\" and the order of the lists are counted on: net for a licensed dealer, total for an exempt one."
          },
          "income": {
            "$ref": "#/components/schemas/Figures"
          },
          "expenses": {
            "$ref": "#/components/schemas/Figures"
          },
          "profit": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Income less expenses, on the basis of the business. Decimal text with exactly two decimals; below zero, with a leading minus, where credits or expenses outweigh it."
          },
          "months": {
            "type": "array",
            "maxItems": 12,
            "description": "Every month of the year, January first, each one present even when it holds nothing.",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string",
                  "maxLength": 2,
                  "pattern": "^(0[1-9]|1[0-2])$",
                  "description": "\"01\" to \"12\"."
                },
                "income": {
                  "$ref": "#/components/schemas/Figures"
                },
                "expenses": {
                  "$ref": "#/components/schemas/Figures"
                },
                "profit": {
                  "type": "string",
                  "maxLength": 21,
                  "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Income less expenses of the month, on the basis of the business. Decimal text with exactly two decimals; below zero, with a leading minus, where credits or expenses outweigh it."
                }
              },
              "required": [
                "month",
                "income",
                "expenses",
                "profit"
              ],
              "additionalProperties": false
            }
          },
          "customers": {
            "type": "array",
            "description": "The income by customer, the largest first.",
            "items": {
              "type": "object",
              "properties": {
                "customerKey": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "The stable key of the customer."
                },
                "customerName": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "The name the customer had on its latest document of the year."
                },
                "documents": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The documents of the year that count as income from the customer."
                },
                "income": {
                  "$ref": "#/components/schemas/Figures"
                }
              },
              "required": [
                "customerKey",
                "customerName",
                "documents",
                "income"
              ],
              "additionalProperties": false
            }
          },
          "categories": {
            "type": "array",
            "description": "The expenses by kind, the largest first.",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "maxLength": 20,
                  "enum": [
                    "materials",
                    "equipment",
                    "office",
                    "vehicle",
                    "travel",
                    "phone",
                    "software",
                    "marketing",
                    "professional",
                    "rent",
                    "insurance",
                    "fees",
                    "training",
                    "other"
                  ],
                  "description": "The kind of expense, one of a fixed list: materials (חומרים וסחורה), equipment (ציוד), office (משרד), vehicle (רכב ודלק), travel (נסיעות), phone (טלפון ואינטרנט), software (תוכנות ומנויים), marketing (פרסום), professional (שירותים מקצועיים), rent (שכירות), insurance (ביטוח), fees (עמלות), training (השתלמויות), other (אחר)."
                },
                "categoryName": {
                  "type": "string",
                  "maxLength": 40,
                  "description": "The kind in the words of the portal."
                },
                "count": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The expenses of the kind in the year."
                },
                "expenses": {
                  "$ref": "#/components/schemas/Figures"
                }
              },
              "required": [
                "category",
                "categoryName",
                "count",
                "expenses"
              ],
              "additionalProperties": false
            }
          },
          "years": {
            "type": "array",
            "description": "Every year that holds a document or an expense that was not removed, the latest first.",
            "items": {
              "type": "string",
              "maxLength": 4,
              "description": "A year that holds a document or an expense."
            }
          }
        },
        "required": [
          "year",
          "dealer",
          "basis",
          "income",
          "expenses",
          "profit",
          "months",
          "customers",
          "categories",
          "years"
        ],
        "additionalProperties": false
      },
      "Figures": {
        "type": "object",
        "description": "One sum three ways. A licensed dealer counts on \"net\", an exempt dealer on \"total\" (see \"basis\").",
        "properties": {
          "net": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "Before VAT. Decimal text with exactly two decimals; below zero, with a leading minus, where credits or expenses outweigh it."
          },
          "vat": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The VAT in it. Decimal text with exactly two decimals; below zero, with a leading minus, where credits or expenses outweigh it."
          },
          "total": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "With VAT, as paid or received. Decimal text with exactly two decimals; below zero, with a leading minus, where credits or expenses outweigh it."
          }
        },
        "required": [
          "net",
          "vat",
          "total"
        ],
        "additionalProperties": false
      },
      "Expense": {
        "type": "object",
        "description": "An expense of the business: a management aid of its owner, in no document, series, uniform file or transmission.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The expense."
          },
          "date": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The day of the expense. \"YYYY-MM-DD\"."
          },
          "supplier": {
            "type": "string",
            "maxLength": 200,
            "description": "Who was paid."
          },
          "amount": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "What was paid, VAT included. Decimal text with exactly two decimals."
          },
          "vat": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The VAT in the amount; \"0.00\" for none."
          },
          "net": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The amount less the VAT."
          },
          "category": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "materials",
              "equipment",
              "office",
              "vehicle",
              "travel",
              "phone",
              "software",
              "marketing",
              "professional",
              "rent",
              "insurance",
              "fees",
              "training",
              "other"
            ],
            "description": "The kind of expense, one of a fixed list: materials (חומרים וסחורה), equipment (ציוד), office (משרד), vehicle (רכב ודלק), travel (נסיעות), phone (טלפון ואינטרנט), software (תוכנות ומנויים), marketing (פרסום), professional (שירותים מקצועיים), rent (שכירות), insurance (ביטוח), fees (עמלות), training (השתלמויות), other (אחר)."
          },
          "categoryName": {
            "type": "string",
            "maxLength": 40,
            "description": "The kind in the words of the portal."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "A note."
          },
          "receipt": {
            "type": [
              "object",
              "null"
            ],
            "description": "The file of the supplier's receipt; null when none is attached.",
            "properties": {
              "id": {
                "type": "string",
                "maxLength": 36,
                "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}$",
                "description": "The stored file."
              },
              "mediaType": {
                "type": "string",
                "maxLength": 20,
                "enum": [
                  "application/pdf",
                  "image/jpeg",
                  "image/png"
                ],
                "description": "Read from the first bytes of the file."
              },
              "fileName": {
                "type": "string",
                "maxLength": 120,
                "description": "The name it was sent under, cleaned."
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 5242880,
                "description": "Its size."
              }
            },
            "required": [
              "id",
              "mediaType",
              "fileName",
              "sizeBytes"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was recorded. ISO 8601, UTC."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was last changed. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "date",
          "supplier",
          "amount",
          "vat",
          "net",
          "category",
          "categoryName",
          "note",
          "receipt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ExpenseReceipt": {
        "type": "object",
        "description": "The picture or PDF of the supplier's receipt in force.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The stored file."
          },
          "mediaType": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png"
            ],
            "description": "Read from the first bytes of the file."
          },
          "fileName": {
            "type": "string",
            "maxLength": 120,
            "description": "The name it was sent under, cleaned."
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5242880,
            "description": "Its size."
          }
        },
        "required": [
          "id",
          "mediaType",
          "fileName",
          "sizeBytes"
        ],
        "additionalProperties": false
      },
      "ExpenseRequest": {
        "type": "object",
        "description": "A new expense. The file of its receipt is sent after it (PUT .../receipt).",
        "properties": {
          "date": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The day of the expense, from 2000-01-01 to 2099-12-31. \"YYYY-MM-DD\"."
          },
          "supplier": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "description": "Who was paid."
          },
          "amount": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "What was paid, VAT included, above zero. Decimal text with exactly two decimals, never a JSON number."
          },
          "vat": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The VAT in the amount, never more than it. Decimal text with exactly two decimals. Left out: none."
          },
          "category": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "materials",
              "equipment",
              "office",
              "vehicle",
              "travel",
              "phone",
              "software",
              "marketing",
              "professional",
              "rent",
              "insurance",
              "fees",
              "training",
              "other"
            ],
            "description": "The kind of expense, one of a fixed list: materials (חומרים וסחורה), equipment (ציוד), office (משרד), vehicle (רכב ודלק), travel (נסיעות), phone (טלפון ואינטרנט), software (תוכנות ומנויים), marketing (פרסום), professional (שירותים מקצועיים), rent (שכירות), insurance (ביטוח), fees (עמלות), training (השתלמויות), other (אחר)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "A note."
          }
        },
        "required": [
          "date",
          "supplier",
          "amount",
          "category"
        ],
        "additionalProperties": false
      },
      "ExpenseChange": {
        "type": "object",
        "description": "The fields to change; every field left out keeps its value. \"note\": null removes the note.",
        "properties": {
          "date": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "The day of the expense, from 2000-01-01 to 2099-12-31. \"YYYY-MM-DD\"."
          },
          "supplier": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "description": "Who was paid."
          },
          "amount": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "What was paid, VAT included, above zero. Decimal text with exactly two decimals, never a JSON number."
          },
          "vat": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The VAT in the amount, never more than it. Decimal text with exactly two decimals. Left out: none."
          },
          "category": {
            "type": "string",
            "maxLength": 20,
            "enum": [
              "materials",
              "equipment",
              "office",
              "vehicle",
              "travel",
              "phone",
              "software",
              "marketing",
              "professional",
              "rent",
              "insurance",
              "fees",
              "training",
              "other"
            ],
            "description": "The kind of expense, one of a fixed list: materials (חומרים וסחורה), equipment (ציוד), office (משרד), vehicle (רכב ודלק), travel (נסיעות), phone (טלפון ואינטרנט), software (תוכנות ומנויים), marketing (פרסום), professional (שירותים מקצועיים), rent (שכירות), insurance (ביטוח), fees (עמלות), training (השתלמויות), other (אחר)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "A note."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "PosItem": {
        "type": "object",
        "description": "An item of the catalog of the register. A change never reaches a document already issued: the sale copies the item into its lines.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The item."
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "The name on the tile and on the line of the document."
          },
          "priceGross": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The price of one unit with VAT; \"0.00\" with an open price. Decimal text with exactly two decimals, never a JSON number."
          },
          "vatKind": {
            "type": "string",
            "maxLength": 8,
            "enum": [
              "standard",
              "exempt",
              "zero"
            ],
            "description": "standard, exempt or zero: the VAT kind of the line for a licensed dealer."
          },
          "unit": {
            "type": "string",
            "maxLength": 20,
            "description": "The unit of the line."
          },
          "itemCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "pattern": "^[A-Za-z0-9_.-]{1,20}$",
            "description": "The code, also the barcode a scanner types; unique among the items in use."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "The tab the tile stands under."
          },
          "colour": {
            "type": "string",
            "maxLength": 5,
            "enum": [
              "stone",
              "grape",
              "mint",
              "sun",
              "sky",
              "rose"
            ],
            "description": "The colour of the tile."
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9999,
            "description": "The order of the tile; smaller first."
          },
          "openPrice": {
            "type": "boolean",
            "description": "True when the price is typed at each sale."
          },
          "needsSerial": {
            "type": "boolean",
            "description": "True for an item of appendix ג of the bookkeeping rules: the register asks the maker and the serial number and puts them on the line."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When the item was made. ISO 8601, UTC."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was last changed. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "name",
          "priceGross",
          "vatKind",
          "unit",
          "itemCode",
          "category",
          "colour",
          "position",
          "openPrice",
          "needsSerial",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "PosItemRequest": {
        "type": "object",
        "description": "An item as a client system keeps it, by its code.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1,
            "description": "The name on the tile and on the line of the document, 1 to 50 characters."
          },
          "price": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The price of one unit with VAT. \"0.00\" only with \"openPrice\": true. Decimal text with exactly two decimals, never a JSON number."
          },
          "vatKind": {
            "type": "string",
            "maxLength": 8,
            "enum": [
              "standard",
              "exempt",
              "zero"
            ],
            "description": "standard (the default), exempt or zero."
          },
          "unit": {
            "type": "string",
            "maxLength": 20,
            "description": "The unit; \"יחידה\" when left out."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "The tab the tile stands under."
          },
          "colour": {
            "type": "string",
            "maxLength": 5,
            "enum": [
              "stone",
              "grape",
              "mint",
              "sun",
              "sky",
              "rose"
            ],
            "description": "The colour of the tile; stone when left out."
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9999,
            "description": "The order of the tile; 0 when left out."
          },
          "openPrice": {
            "type": "boolean",
            "description": "True when the price is typed at each sale."
          },
          "needsSerial": {
            "type": "boolean",
            "description": "True for an item of appendix ג (a television, a radio and the like)."
          }
        },
        "required": [
          "name",
          "price"
        ],
        "additionalProperties": false
      },
      "PosRegister": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The register."
          },
          "name": {
            "type": "string",
            "maxLength": 40,
            "description": "Its name (\"קופה 1\")."
          },
          "open": {
            "type": "boolean",
            "description": "True while a shift of the register is open."
          },
          "openShiftId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 36,
            "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}$",
            "description": "The open shift."
          },
          "lastCloseNo": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of its last close; 0 before the first."
          },
          "createdAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When it was made. ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "name",
          "open",
          "openShiftId",
          "lastCloseNo",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "PosClose": {
        "type": "object",
        "description": "A close of a register (\"סגירת קופה\"). Insert-only: it never changes.",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The close."
          },
          "registerId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The register."
          },
          "registerName": {
            "type": "string",
            "maxLength": 40,
            "description": "Its name."
          },
          "shiftId": {
            "type": "string",
            "maxLength": 36,
            "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}$",
            "description": "The shift it closed."
          },
          "closeNo": {
            "type": "integer",
            "minimum": 1,
            "description": "Its number on its register: 1, 2, 3 and on, with no gap."
          },
          "closedAt": {
            "type": "string",
            "maxLength": 30,
            "format": "date-time",
            "description": "When. ISO 8601, UTC."
          },
          "closedBy": {
            "type": "string",
            "maxLength": 200,
            "description": "Who closed."
          },
          "countedCash": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "The cash counted in the drawer. Decimal text with exactly two decimals, never a JSON number."
          },
          "difference": {
            "type": "string",
            "maxLength": 21,
            "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
            "description": "countedCash - figures.cash.expected. Decimal text with exactly two decimals; below zero when cash is missing."
          },
          "figuresSha256": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the stored figures, lower-case hex."
          },
          "figures": {
            "$ref": "#/components/schemas/PosFigures"
          }
        },
        "required": [
          "id",
          "registerId",
          "registerName",
          "shiftId",
          "closeNo",
          "closedAt",
          "closedBy",
          "countedCash",
          "difference",
          "figuresSha256",
          "figures"
        ],
        "additionalProperties": false
      },
      "PosFigures": {
        "type": "object",
        "description": "The figures of a shift, computed from the documents issued in it (the permanent file) and stored as they were shown at the close.",
        "properties": {
          "dealer": {
            "type": "string",
            "maxLength": 8,
            "enum": [
              "licensed",
              "exempt"
            ],
            "description": "licensed or exempt."
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "The opening of the shift. ISO 8601, UTC."
              },
              "to": {
                "type": "string",
                "maxLength": 30,
                "format": "date-time",
                "description": "The moment of the close. ISO 8601, UTC."
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "openedBy": {
            "type": "string",
            "maxLength": 200,
            "description": "Who opened the shift."
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "docType": {
                  "type": "integer",
                  "enum": [
                    320,
                    400
                  ],
                  "description": "The type of document."
                },
                "count": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many."
                },
                "first": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "The first number."
                },
                "last": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "The last number."
                }
              },
              "required": [
                "docType",
                "count",
                "first",
                "last"
              ],
              "additionalProperties": false
            }
          },
          "sales": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "Sales that were not cancelled."
              },
              "total": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Their total, as received. Decimal text with exactly two decimals, never a JSON number."
              },
              "net": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Before VAT. Decimal text with exactly two decimals, never a JSON number."
              },
              "vat": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The VAT in them. Decimal text with exactly two decimals, never a JSON number."
              },
              "discount": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The discounts on their lines and on the whole sale. Decimal text with exactly two decimals, never a JSON number."
              }
            },
            "required": [
              "count",
              "total",
              "net",
              "vat",
              "discount"
            ],
            "additionalProperties": false
          },
          "vatGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "vatKind": {
                  "type": "string",
                  "maxLength": 8,
                  "description": "standard, exempt or zero."
                },
                "rate": {
                  "type": "string",
                  "maxLength": 6,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The rate, in per cent."
                },
                "net": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Before VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "vat": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "The VAT. Decimal text with exactly two decimals, never a JSON number."
                },
                "total": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "With VAT. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "vatKind",
                "rate",
                "net",
                "vat",
                "total"
              ],
              "additionalProperties": false
            }
          },
          "receipts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "integer",
                  "description": "The means of payment by field 1306: 1 cash, 2 cheque, 3 card, 4 transfer, 5 voucher, 9 other (Bit included)."
                },
                "name": {
                  "type": "string",
                  "maxLength": 40,
                  "description": "Its name in Hebrew."
                },
                "count": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many payment lines."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Their sum. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "method",
                "name",
                "count",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "cancelled": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "Sales of the shift that were cancelled before their original left."
              },
              "total": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Their total. Decimal text with exactly two decimals, never a JSON number."
              },
              "numbers": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "The number of a cancelled document."
                }
              }
            },
            "required": [
              "count",
              "total",
              "numbers"
            ],
            "additionalProperties": false
          },
          "returns": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "Whole sales returned in the shift."
              },
              "credited": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The total of their credit notes. Decimal text with exactly two decimals, never a JSON number."
              },
              "refunded": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The money given back, above zero. Decimal text with exactly two decimals, never a JSON number."
              },
              "byMethod": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "method": {
                      "type": "integer",
                      "description": "The means of payment by field 1306."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 40,
                      "description": "Its name in Hebrew."
                    },
                    "amount": {
                      "type": "string",
                      "maxLength": 20,
                      "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                      "description": "Given back by it, above zero. Decimal text with exactly two decimals, never a JSON number."
                    }
                  },
                  "required": [
                    "method",
                    "name",
                    "amount"
                  ],
                  "additionalProperties": false
                }
              },
              "numbers": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "The number of a returned sale."
                }
              }
            },
            "required": [
              "count",
              "credited",
              "refunded",
              "byMethod",
              "numbers"
            ],
            "additionalProperties": false
          },
          "cash": {
            "type": "object",
            "properties": {
              "opening": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "The opening float. Decimal text with exactly two decimals, never a JSON number."
              },
              "sales": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Cash received in the sales. Decimal text with exactly two decimals, never a JSON number."
              },
              "refunds": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Cash given back in returns. Decimal text with exactly two decimals, never a JSON number."
              },
              "moneyIn": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Money put into the drawer that is not takings. Decimal text with exactly two decimals, never a JSON number."
              },
              "moneyOut": {
                "type": "string",
                "maxLength": 20,
                "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "Money taken out of the drawer. Decimal text with exactly two decimals, never a JSON number."
              },
              "expected": {
                "type": "string",
                "maxLength": 21,
                "pattern": "^-?(0|[1-9][0-9]*)\\.[0-9]{2}$",
                "description": "opening + sales - refunds + moneyIn - moneyOut. Decimal text with exactly two decimals; may be below zero."
              }
            },
            "required": [
              "opening",
              "sales",
              "refunds",
              "moneyIn",
              "moneyOut",
              "expected"
            ],
            "additionalProperties": false
          },
          "moves": {
            "type": "object",
            "properties": {
              "in": {
                "type": "integer",
                "minimum": 0,
                "description": "Money put in, how many times."
              },
              "out": {
                "type": "integer",
                "minimum": 0,
                "description": "Money taken out, how many times."
              },
              "drawer": {
                "type": "integer",
                "minimum": 0,
                "description": "The drawer opened with no sale, how many times."
              }
            },
            "required": [
              "in",
              "out",
              "drawer"
            ],
            "additionalProperties": false
          },
          "cheques": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "documentNumber": {
                  "type": "string",
                  "maxLength": 20,
                  "description": "The document the cheque paid."
                },
                "chequeNumber": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "Its number."
                },
                "bank": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "The bank."
                },
                "branch": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "The branch."
                },
                "account": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "The account."
                },
                "dueDate": {
                  "type": "string",
                  "maxLength": 10,
                  "description": "Its date, \"YYYY-MM-DD\"."
                },
                "amount": {
                  "type": "string",
                  "maxLength": 20,
                  "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
                  "description": "Its amount. Decimal text with exactly two decimals, never a JSON number."
                }
              },
              "required": [
                "documentNumber",
                "chequeNumber",
                "bank",
                "branch",
                "account",
                "dueDate",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "dealer",
          "period",
          "openedBy",
          "documents",
          "sales",
          "vatGroups",
          "receipts",
          "cancelled",
          "returns",
          "cash",
          "moves",
          "cheques"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "description": "Every error has this body.",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "maxLength": 60,
                "description": "The code of the error. Match on this, never on the message."
              },
              "message": {
                "type": "string",
                "maxLength": 400,
                "description": "A fixed sentence for the code. It never holds data."
              },
              "messageHe": {
                "type": "string",
                "maxLength": 400,
                "description": "The same sentence in Hebrew, for the codes of access a developer meets while setting up a key (KEY_SCOPE_MISSING, KEY_ADDRESS_NOT_ALLOWED)."
              },
              "details": {
                "type": "object",
                "description": "What differs from one request to the next.",
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              },
              "issues": {
                "type": "array",
                "description": "Only with DOCUMENT_REFUSED: every reason the request was refused.",
                "items": {
                  "$ref": "#/components/schemas/Issue"
                }
              },
              "requestId": {
                "type": "string",
                "maxLength": 64,
                "description": "The identifier of the request, also in the X-Request-Id header."
              }
            },
            "required": [
              "code",
              "message",
              "details",
              "requestId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-scopes": {
    "read": "Read: every GET route but those of the finances (businesses, drafts, documents and their copies, customers, delivery records, uniform files and reports, transmission and allocation state, backups, reference data) and the lookups of a received invoice.",
    "issue": "Issue: prepare and confirm a document, cancel one, and the allocation numbers of the Tax Authority (ask, record, decide).",
    "delivery": "Delivery: make, revoke and email a personal link, and report or withdraw the consent of a customer.",
    "records": "Records: produce a uniform-structure file, transmit it and ask for its status, and start a backup.",
    "businesses": "Businesses: add a business to the register, and choose the design of the documents of a business this client serves. Never held by a key of the direct connection of a business, whose owner chooses the design in the portal.",
    "webhooks": "Webhooks: manage the subscriptions to events of the client system.",
    "finance": "Finance: read the year of a business (income, expenses and profit by month, by customer and by category), its expenses and the file of the receipt of each. Held only by a key of the direct connection of the business.",
    "expenses": "Expenses: record, correct and remove an expense of the business, and attach the file of its receipt. Held only by a key of the direct connection of the business.",
    "pos": "Register: read the catalog, the registers and the closes of the register of the business, and keep its catalog by item code. Held only by a key of the direct connection of the business."
  },
  "x-error-codes": {
    "ACTOR_NOT_ALLOWED": {
      "status": 403,
      "message": "This action belongs to a user of the business, in the portal of the product."
    },
    "ALLOCATE_TIMEOUT": {
      "status": 503,
      "message": "The time limit passed. What the choice depended on was not stored and nothing was reported; the same request can be sent again."
    },
    "ALLOCATION_IN_PROGRESS": {
      "status": 409,
      "message": "Another call is asking the Tax Authority about this document at this moment. Read the state of its allocation number in a moment."
    },
    "ALLOCATION_NUMBER_REQUIRED": {
      "status": 409,
      "message": "The buyer demanded an allocation number, the invoice needs one, and neither a number nor a decision in its place (continue, reverse charge, cancel) is recorded. Its original does not leave the business until then, so no link is made. Ask for the number (it is asked at the issue where the business is connected) or record one; a copy may be fetched meanwhile."
    },
    "ALREADY_CANCELLED": {
      "status": 409,
      "message": "The document is already cancelled."
    },
    "AUTHORITY_FAILED": {
      "status": 502,
      "message": "The Tax Authority answered with a fault of its own, or with something that cannot be read. Send the same request again later to go on from there."
    },
    "AUTHORITY_NOT_CONFIGURED": {
      "status": 503,
      "message": "This deployment holds no addresses and credentials of the Tax Authority for its environment. Nothing was sent."
    },
    "AUTHORITY_REFUSED": {
      "status": 422,
      "message": "The Tax Authority refused: the request, the permission, or the file. details.reasons holds its words as received."
    },
    "AUTHORITY_UNREACHABLE": {
      "status": 503,
      "message": "No answer came from the Tax Authority. What was recorded stands; send the same request again later to go on from there."
    },
    "AUTHORIZATION_DENIED": {
      "status": 403,
      "message": "The sign-in at the Tax Authority was refused."
    },
    "BACKUP_FAILED": {
      "status": 500,
      "message": "The backup could not be made. Nothing was recorded."
    },
    "BACKUP_IN_PROGRESS": {
      "status": 409,
      "message": "A backup of this business is being made at this moment. List the backups in a moment."
    },
    "BACKUP_LIMIT": {
      "status": 429,
      "message": "This business made as many backups on request in the last 24 hours as it may (details.perDay). The latest backup can still be taken in the portal, and the quarterly backup is not counted. Retry after the number of seconds in Retry-After."
    },
    "CONSENT_REQUIRED": {
      "status": 403,
      "message": "The recipient has not consented to computerized documents of this business. Nothing was handed out."
    },
    "CONSENT_WITHDRAWN": {
      "status": 409,
      "message": "The recipient withdrew the consent to computerized documents of this business. Nothing is sent to them until a new consent is recorded."
    },
    "CONSISTENCY_CHECK_FAILED": {
      "status": 500,
      "message": "The files were built and did not pass their own check. Nothing was produced."
    },
    "CORRECTION_NOT_CANCELLABLE": {
      "status": 409,
      "message": "The document corrects another document (a cancelling receipt or a correcting transaction invoice) and is never cancelled. A mistake in it is put right by a further document."
    },
    "COUNTER_MISSING": {
      "status": 500,
      "message": "The business has no number series for this document type. Nothing was issued."
    },
    "DATABASE_REFUSED": {
      "status": 500,
      "message": "The database refused the request. Nothing was issued, stored or handed out."
    },
    "DEALER_NUMBER_CHANGED_IN_RANGE": {
      "status": 409,
      "message": "Documents of the range were issued under different dealer numbers. Produce each period apart."
    },
    "DECLARATION_REQUIRED": {
      "status": 422,
      "message": "A cancellation needs the statement of the business that the document was not yet reported: send declaredUnreported as true, and only when the business itself said so."
    },
    "DELIVER_TIMEOUT": {
      "status": 503,
      "message": "The time limit passed. Nothing was stored or handed out; the same request can be sent again."
    },
    "DESIGN_REFUSED": {
      "status": 422,
      "message": "The design was not stored; details.field and details.reason say why, details.suggestion offers a readable colour, details.word names a word the line may not hold.",
      "messageHe": "העיצוב לא נשמר. בפרטים כתוב איזה שדה ולמה; לצבע בהיר מדי מוצע גוון כהה וקריא של אותו צבע."
    },
    "DIRECTORY_UNAVAILABLE": {
      "status": 503,
      "message": "No free directory name was found for this production. Try again later."
    },
    "DOCUMENT_CANCELLED": {
      "status": 410,
      "message": "The document is cancelled. Nothing of it is sent to anyone; the business can fetch its \"מבוטל\" view."
    },
    "DOCUMENT_REFERENCED": {
      "status": 409,
      "message": "Another standing document relates to this one. It cannot be cancelled."
    },
    "DOCUMENT_REFUSED": {
      "status": 422,
      "message": "The document was refused; issues lists every reason. Nothing was stored."
    },
    "DRAFT_ABANDONED": {
      "status": 410,
      "message": "The draft was abandoned. Prepare again under a new Idempotency-Key."
    },
    "DRAFT_CONFIRMED": {
      "status": 409,
      "message": "The draft already became a document; details.documentId names it."
    },
    "DRAFT_CORRUPT": {
      "status": 500,
      "message": "The stored draft is not what the prepare stored. Nothing was issued."
    },
    "DRAFT_EXPIRED": {
      "status": 410,
      "message": "The draft expired. Prepare again under a new Idempotency-Key."
    },
    "DRAFT_STALE": {
      "status": 409,
      "message": "What the draft was computed from has changed since it was prepared. Nothing was issued; prepare again under a new Idempotency-Key."
    },
    "EXPENSE_REFUSED": {
      "status": 422,
      "message": "The expense was not stored. details names each field that was refused with the reason in one fixed word: date-invalid, supplier-missing, supplier-long, amount-invalid, vat-invalid, vat-above-amount, category-unknown, note-long, file-kind (not a JPEG, PNG or PDF by its first bytes, or not the media type it was sent as), file-large, file-empty.",
      "messageHe": "ההוצאה לא נשמרה. בפרטים כתוב איזה שדה נדחה ולמה."
    },
    "EXPENSE_REMOVED": {
      "status": 410,
      "message": "The expense recorded under this Idempotency-Key was removed since; details.expenseId names it. Nothing was recorded. Record a new expense under a new key."
    },
    "FILE_TOO_LARGE": {
      "status": 422,
      "message": "The file is larger than the Tax Authority allows for this business. It was not sent; details.supportAddress is where the business may write."
    },
    "IDEMPOTENCY_KEY_INVALID": {
      "status": 422,
      "message": "The Idempotency-Key header is missing or is not 1 to 255 printable ASCII characters."
    },
    "IDEMPOTENCY_KEY_REUSED": {
      "status": 409,
      "message": "The Idempotency-Key was already used with a different request."
    },
    "INPUT_INVALID": {
      "status": 422,
      "message": "A value of the request is not usable; details.field names it."
    },
    "INTERNAL": {
      "status": 500,
      "message": "The request failed inside the service. Nothing is known to have changed; the requestId identifies it."
    },
    "INVALID_INPUT": {
      "status": 422,
      "message": "The range is not two calendar dates in order that end no later than today in Israel; details.field names the one at fault."
    },
    "ISSUER_ALREADY_EXISTS": {
      "status": 409,
      "message": "This client already created a business with this registration number, or already acts for it; details.issuerId names it."
    },
    "ISSUER_NOT_ACTIVE": {
      "status": 409,
      "message": "The business is not active."
    },
    "ISSUER_REGISTERED": {
      "status": 409,
      "message": "Another business of the register holds this registration number, and this client may not act for it; nothing was added. Its owner is asked in the portal to give this client permission (details.grantRequest \"pending\"; \"declined\" within 30 days of a refusal). Once given, GET /v1/issuers lists the business."
    },
    "ISSUE_TIMEOUT": {
      "status": 503,
      "message": "The time limit of issuing passed. Nothing was issued; the same confirm can be sent again."
    },
    "KEY_ADDRESS_NOT_ALLOWED": {
      "status": 403,
      "message": "The API key is limited to a list of networks, and this request came from an address outside it; details.address is the address the service saw. Nothing was done. Add the network to the key in the portal, or send the request from an allowed address.",
      "messageHe": "המפתח מוגבל לרשימת כתובות, והבקשה הגיעה מכתובת שאינה ברשימה. שום דבר לא בוצע. אפשר להוסיף את הכתובת למפתח בפורטל, או לשלוח מכתובת מורשית."
    },
    "KEY_SCOPE_MISSING": {
      "status": 403,
      "message": "The API key does not hold the scope this route needs; details.requiredScope names it and details.keyScopes lists what the key holds. Nothing was done. Give the key the scope in the portal, or use a key that holds it.",
      "messageHe": "למפתח אין את ההרשאה שהפעולה הזאת דורשת. שום דבר לא בוצע. אפשר להוסיף למפתח את ההרשאה בפורטל, או להשתמש במפתח שיש לו אותה."
    },
    "LINK_NOT_ACTIVE": {
      "status": 409,
      "message": "The link is revoked or past its time. Make a new link."
    },
    "MAILER_NOT_CONFIGURED": {
      "status": 501,
      "message": "This deployment sends no email. Nothing was sent; take the link and send it through your own channel."
    },
    "MAIL_FAILED": {
      "status": 502,
      "message": "The mail service refused the message. Nothing was sent; the link itself stands."
    },
    "MAIL_OUTCOME_UNKNOWN": {
      "status": 504,
      "message": "It is not known whether the message was sent: the mail service did not answer in time. The link itself stands. Sending again may deliver a second message."
    },
    "MALFORMED_JSON": {
      "status": 400,
      "message": "The body is not valid JSON."
    },
    "NOT_FOUND": {
      "status": 404,
      "message": "Not found."
    },
    "ORIGINAL_RELEASED": {
      "status": 409,
      "message": "The original of the document already left the business, so the document cannot be cancelled. details.correction names the document that corrects it instead: \"credit-note\" for a tax invoice (issue a 330), \"cancelling-receipt\" for a receipt (issue a 400 with `corrects`), \"correcting-invoice\" for a transaction invoice (issue a 300 with `corrects`); null for a credit note."
    },
    "OUTCOME_UNKNOWN": {
      "status": 504,
      "message": "It is not known whether the request took effect: the answer of the database was lost. Send the same request again to learn the outcome. After a confirm that means: send the same confirm again, and do not prepare again under a new Idempotency-Key."
    },
    "OWNER_ONLY": {
      "status": 403,
      "message": "Signing in at the Tax Authority, and ending the connection, belong to a user of the business in the portal of the product."
    },
    "PAYLOAD_TOO_LARGE": {
      "status": 413,
      "message": "The request body is larger than the limit."
    },
    "PAYMENT_MEANS_NOT_ALLOWED": {
      "status": 409,
      "message": "The payment-means condition of a secured signature is applied for this business, and the document does not show its payment by the customer's card, a crossed cheque marked \"לא סחיר\" (crossedNotNegotiable) or a bank transfer: details.methods names the other codes of field 1306, details.expectedMeansMissing an invoice that stated none. Nothing is sent by computer; the original goes on paper."
    },
    "POS_ITEM_REFUSED": {
      "status": 422,
      "message": "The item was not stored. details names each field that was refused with the reason in one fixed word: required, too-long, invalid, taken (the code is in use by another item), too-many (500 items in use already).",
      "messageHe": "הפריט לא נשמר. בפרטים כתוב איזה שדה נדחה ולמה."
    },
    "PRIMARY_ID_TAKEN": {
      "status": 409,
      "message": "The primary identifier belongs to an earlier production."
    },
    "PRODUCTION_SWITCHED_OFF": {
      "status": 503,
      "message": "The production addresses of the Tax Authority are switched off in this deployment. Nothing was sent."
    },
    "RATE_LIMITED": {
      "status": 429,
      "message": "Too many requests. Wait for the number of seconds in the Retry-After header."
    },
    "REGISTRATION_NOT_IN_FORCE": {
      "status": 503,
      "message": "No registration certificate is in force for the running edition. Nothing was issued."
    },
    "RENDER_FAILED": {
      "status": 500,
      "message": "The document file could not be produced. Nothing was issued, stored or handed out. details.reason says why, in one fixed word: \"render-timeout\" and \"browser-unavailable\" can pass by themselves, and the same request may then be sent again."
    },
    "REQUEST_INVALID": {
      "status": 422,
      "message": "The request is not in the form this route takes; details name the place."
    },
    "SIGNATURE_NOT_VERIFIED": {
      "status": 500,
      "message": "The signature of the document file did not verify. Nothing was issued, stored or handed out."
    },
    "SIGNING_FAILED": {
      "status": 500,
      "message": "The document file could not be signed. Nothing was issued, stored or handed out."
    },
    "SIGNING_KEY_UNAVAILABLE": {
      "status": 500,
      "message": "The business has no usable signing key. Nothing was issued, stored or handed out."
    },
    "SIGN_IN_REQUIRED": {
      "status": 409,
      "message": "The business holds no usable connection to the Tax Authority: its owner must sign in there, in the portal of the product. Nothing was sent."
    },
    "STATE_INVALID": {
      "status": 409,
      "message": "The sign-in that came back is not one this user started, or it was used, or its time passed."
    },
    "STORED_PRODUCTION_DAMAGED": {
      "status": 500,
      "message": "The stored production no longer matches the hashes it was stored with. Nothing is handed out."
    },
    "TOKEN_STORE_UNREADABLE": {
      "status": 500,
      "message": "The stored tokens of the business cannot be opened. Nothing was sent."
    },
    "TRANSMISSION_IN_PROGRESS": {
      "status": 409,
      "message": "Another call is transmitting this production at this moment."
    },
    "UNAUTHENTICATED": {
      "status": 401,
      "message": "Authentication failed."
    },
    "UNAVAILABLE": {
      "status": 503,
      "message": "The service is not accepting requests right now. Try again shortly."
    },
    "UNSUPPORTED_MEDIA_TYPE": {
      "status": 415,
      "message": "A request body must be sent as application/json; a route that takes a file takes it as its own body, with the media type the route names."
    },
    "VALUE_REFUSED": {
      "status": 422,
      "message": "A stored value cannot be written exactly into its field of the file; details.field names it. Nothing was produced."
    },
    "WEBHOOKS_NOT_CONFIGURED": {
      "status": 503,
      "message": "This deployment posts no webhook notices: no address can be registered or posted to. The events can still be read (GET /v1/events).",
      "messageHe": "השרת הזה לא שולח התראות webhook: אי אפשר לרשום כתובת. את האירועים אפשר לקרוא ב-GET /v1/events."
    },
    "WEBHOOK_DELIVERY_PENDING": {
      "status": 409,
      "message": "The delivery is still waiting for its next try, or is being sent at this moment. Ask again once it ended.",
      "messageHe": "המשלוח עוד ממתין לניסיון הבא או נשלח ממש עכשיו. אפשר לבקש שוב כשיסתיים."
    },
    "WEBHOOK_ENDPOINT_DELETED": {
      "status": 409,
      "message": "The webhook address is deleted. Nothing is posted to it any more; register a new one.",
      "messageHe": "כתובת ה-webhook נמחקה ולא נשלח אליה דבר. אפשר לרשום כתובת חדשה."
    },
    "WEBHOOK_ENDPOINT_LIMIT": {
      "status": 409,
      "message": "A client system holds at most 16 webhook addresses that are not deleted (details.limit). Delete one first.",
      "messageHe": "למערכת יכולות להיות עד 16 כתובות webhook פעילות. צריך למחוק אחת קודם."
    },
    "WEBHOOK_TEST_TOO_SOON": {
      "status": 429,
      "message": "A test notice was posted to this address a moment ago (one every 5 seconds), or this client system posted ten in the last minute. Wait for the number of seconds in Retry-After.",
      "messageHe": "התראת בדיקה נשלחה לכתובת הזו לפני רגע, או שהמערכת שלחה עשר בדקה האחרונה. צריך לחכות את מספר השניות שב-Retry-After."
    }
  }
}
