{
  "components": {
    "schemas": {
      "AccessPointFinding": {
        "description": "`AccessPointFinding` is one finding of the access point's Peppol validation.",
        "properties": {
          "severity": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "severity",
          "message"
        ],
        "type": "object"
      },
      "Account": {
        "properties": {
          "id": {
            "description": "`id` is the IBAN, or the account number where there is no IBAN (BT-84).",
            "type": "string"
          },
          "name": {
            "description": "EN 16931 BT-85",
            "type": "string"
          },
          "bic": {
            "description": "EN 16931 BT-86",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "Address": {
        "properties": {
          "street": {
            "type": "string"
          },
          "street2": {
            "type": "string"
          },
          "street3": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "subdivision": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        },
        "required": [
          "country"
        ],
        "type": "object"
      },
      "Adjustment": {
        "description": "`Adjustment` is an allowance or a charge. Its amount is given outright, or as Percent of BaseAmount.",
        "properties": {
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "description": "`reason_code` is a UNCL5189 code for an allowance, UNCL7161 for a charge.",
            "type": "string"
          },
          "amount": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "percent": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "base_amount": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "AllowanceCharge": {
        "description": "`AllowanceCharge` is a document-level allowance or charge, which carries the VAT it is subject to.",
        "properties": {
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "description": "`reason_code` is a UNCL5189 code for an allowance, UNCL7161 for a charge.",
            "type": "string"
          },
          "amount": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "percent": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "base_amount": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "vat": {
            "$ref": "#/components/schemas/VAT"
          }
        },
        "required": [
          "vat"
        ],
        "type": "object"
      },
      "ApiKey": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "description": "`prefix` is the start of the key, enough to tell it from the others.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "key": {
            "description": "`key` is the key itself, present only in the answer that creates it.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt"
        ],
        "type": "object"
      },
      "ApiKeyRequest": {
        "description": "Types the handlers read that are worth a name.",
        "properties": {
          "name": {
            "description": "`name` tells the key from the company's other keys.",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Attachment": {
        "description": "`Attachment` is a supporting document: embedded as Content, referred to by URL, or only named, by ID and Description. Some countries use the last form for a number the tax authority has issued for the invoice.",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "content": {
            "description": "`content` is the file, base64-encoded.",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Attribute": {
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ],
        "type": "object"
      },
      "AuditEntry": {
        "description": "`AuditEntry` is something someone did.",
        "properties": {
          "id": {
            "type": "string"
          },
          "at": {
            "type": "string"
          },
          "action": {
            "description": "`action` names what was done, such as document.send, api_key.create or company.settings.",
            "type": "string"
          },
          "target": {
            "description": "`target` is the id of what it was done to: a document, a key, a webhook.",
            "type": "string"
          },
          "companyId": {
            "description": "`companyId` is the company it was about; none for the account's own.",
            "type": "string"
          },
          "actor": {
            "description": "`actor` is who did it: kind person (id is the person's user id), key (the API key's id) or dev.",
            "properties": {
              "kind": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          "request": {
            "description": "`request` is the call as made.",
            "properties": {
              "method": {
                "type": "string"
              },
              "path": {
                "type": "string"
              }
            },
            "required": [
              "method",
              "path"
            ],
            "type": "object"
          },
          "address": {
            "description": "`address` is where the request came from.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "at",
          "action",
          "actor",
          "request"
        ],
        "type": "object"
      },
      "Balance": {
        "description": "`Balance` is how far the account is into its month, against its plan in the SaaS kit. Only sent documents count; received ones, and those of a company in test mode, cost nothing.",
        "properties": {
          "plan": {
            "description": "`plan` names the account's plan, as the person's sign-in says; empty for a key, which may ask the kit through the portal for the figures alone.",
            "type": "string"
          },
          "counted": {
            "description": "`counted` says the kit keeps the count; false where the portal runs without it, when nothing below is known.",
            "type": "boolean"
          },
          "sent": {
            "description": "`sent` is how many documents were sent this month (UTC), and `included` how many the plan includes.",
            "type": "integer"
          },
          "included": {
            "type": "integer"
          },
          "overage": {
            "description": "`overage` is the price of each document beyond `included`, in minor units of `currency`, billed afterwards. Zero: `included` is a cap, and `remaining` is what is left of it.",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "remaining": {
            "type": "integer"
          },
          "periodStart": {
            "description": "`periodStart` and `periodEnd` are the month the counts are for.",
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "enforced": {
            "description": "`enforced` says whether a used-up cap stops sending.",
            "type": "boolean"
          }
        },
        "required": [
          "counted",
          "sent",
          "included",
          "enforced"
        ],
        "type": "object"
      },
      "BillingReference": {
        "properties": {
          "number": {
            "type": "string"
          },
          "issue_date": {
            "type": "string"
          }
        },
        "required": [
          "number"
        ],
        "type": "object"
      },
      "Card": {
        "description": "`Card` is the card an invoice was paid with. Number is only its last four to six digits.",
        "properties": {
          "number": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "holder": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "network"
        ],
        "type": "object"
      },
      "Classification": {
        "description": "`Classification` places an item in a classification scheme, such as CPV.",
        "properties": {
          "code": {
            "type": "string"
          },
          "list_id": {
            "description": "`list_id` is the scheme's UNCL7143 code.",
            "type": "string"
          },
          "list_version": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "list_id"
        ],
        "type": "object"
      },
      "Code": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "Company": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "registrationNumber": {
            "type": "string"
          },
          "peppolId": {
            "type": "string"
          },
          "sandbox": {
            "description": "`sandbox` companies are for trying things out: off the Peppol network.",
            "type": "boolean"
          },
          "sendOnly": {
            "description": "`sendOnly` says the company only sends through the portal: it is not published on the network as a receiver.",
            "type": "boolean"
          },
          "status": {
            "description": "`status` is PROVISIONING until the access point knows the company, then the participant's status there, or FAILED with statusDetail.",
            "type": "string"
          },
          "statusDetail": {
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/CompanySettings"
          },
          "inboundAddress": {
            "description": "`inboundAddress` is where documents are emailed to for the company: an attachment in any format the portal reads becomes a draft. Only mail from the senders in settings.mailSenders is taken in.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "countryCode",
          "registrationNumber",
          "peppolId",
          "sandbox",
          "sendOnly",
          "status",
          "settings",
          "createdAt"
        ],
        "type": "object"
      },
      "CompanyRequest": {
        "description": "Types the handlers read that are worth a name.",
        "properties": {
          "name": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "scheme": {
            "description": "`scheme` and `identifier` are the company's Peppol ID. `scheme` may be left out where the country has one usual scheme.",
            "type": "string"
          },
          "identifier": {
            "type": "string"
          },
          "registrationNumber": {
            "description": "`registrationNumber` is an older name for `identifier`.",
            "type": "string"
          },
          "sandbox": {
            "description": "`sandbox` makes a company for trying things out, off the network.",
            "type": "boolean"
          },
          "sendOnly": {
            "description": "`sendOnly` makes a company that sends through the portal but is not published on the network as a receiver: it receives elsewhere, or not at all. Receiving can be turned on later.",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "countryCode",
          "identifier"
        ],
        "type": "object"
      },
      "CompanySettings": {
        "description": "`CompanySettings` are what a company's users choose themselves.",
        "properties": {
          "forwardEmails": {
            "description": "`forwardEmails` are where received documents are forwarded to.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "mailSenders": {
            "description": "`mailSenders` are the addresses that may email documents in for the company; mail from anyone else is dropped. `mailSend` has a document that arrived by mail and has no errors sent at once.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "mailSend": {
            "type": "boolean"
          },
          "embedPdf": {
            "description": "`embedPdf` puts the document drawn as a PDF inside what is sent, as an attachment, for receivers whose systems show one.",
            "type": "boolean"
          },
          "language": {
            "description": "`language` is what the company is written to in, and its documents drawn in: one of the portal's languages (sv, en, de, fr, nl, da, nb, fi, it, es); empty means the language of the company's country.",
            "type": "string"
          },
          "street": {
            "description": "The rest is what the company puts on the invoices it sends.",
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "vatNumber": {
            "type": "string"
          },
          "fTax": {
            "description": "FTax: the company is approved for F-tax, which a Swedish invoice states.",
            "type": "boolean"
          },
          "iban": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          }
        },
        "required": [
          "forwardEmails",
          "mailSenders",
          "mailSend",
          "embedPdf",
          "language",
          "street",
          "postalCode",
          "city",
          "vatNumber",
          "fTax",
          "iban",
          "bic"
        ],
        "type": "object"
      },
      "Counterparty": {
        "properties": {
          "name": {
            "type": "string"
          },
          "peppolId": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "peppolId"
        ],
        "type": "object"
      },
      "Delivery": {
        "properties": {
          "name": {
            "description": "EN 16931 BT-70, who it is delivered to",
            "type": "string"
          },
          "location_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              }
            ],
            "description": "EN 16931 BT-71"
          },
          "date": {
            "description": "EN 16931 BT-72",
            "type": "string"
          },
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "EN 16931 BG-15"
          }
        },
        "type": "object"
      },
      "Difference": {
        "properties": {
          "term": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "stated": {
            "type": "string"
          },
          "computed": {
            "type": "string"
          }
        },
        "required": [
          "term",
          "name",
          "stated",
          "computed"
        ],
        "type": "object"
      },
      "DirectDebit": {
        "properties": {
          "mandate_id": {
            "description": "EN 16931 BT-89",
            "type": "string"
          },
          "creditor_id": {
            "description": "EN 16931 BT-90",
            "type": "string"
          },
          "account": {
            "description": "EN 16931 BT-91, the account debited",
            "type": "string"
          }
        },
        "required": [
          "mandate_id"
        ],
        "type": "object"
      },
      "Document": {
        "description": "`Document` is a single document in full.",
        "properties": {
          "id": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "INVOICE",
              "CREDIT_NOTE",
              "DEBIT_NOTE",
              "PREPAYMENT_INVOICE",
              "SELF_BILLING_INVOICE",
              "SELF_BILLING_CREDIT_NOTE"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "draft",
              "queued",
              "sending",
              "delivered",
              "unconfirmed",
              "invalid",
              "failed",
              "received"
            ],
            "type": "string"
          },
          "source": {
            "description": "`source` is \"ubl\" for a document uploaded as finished UBL.",
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "issueDate": {
            "type": "string"
          },
          "dueDate": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "payableAmount": {
            "type": "string"
          },
          "counterparty": {
            "$ref": "#/components/schemas/Counterparty"
          },
          "error": {
            "description": "`error` says why a failed or unconfirmed document is in that state.",
            "type": "string"
          },
          "warnings": {
            "description": "`warnings` are what looked wrong about a received document when it arrived, for a person to judge before paying: a sender that is not the seller, a new account, a repeated number. A draft read from another format has totals_recomputed when its totals, computed, came to otherwise than the file stated.",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          },
          "response": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentResponse"
              }
            ],
            "description": "`response` is the latest Invoice `response` about the document: sent by the company about a received one, or received about a sent one."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "document": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentContent"
              }
            ],
            "description": "`document` is the content as the client wrote it."
          },
          "validation": {
            "description": "`validation` lists what must be fixed before the draft can be sent.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            },
            "type": "array"
          },
          "validationErrors": {
            "description": "`validationErrors` are the access point's findings on a document in state invalid.",
            "items": {
              "$ref": "#/components/schemas/AccessPointFinding"
            },
            "type": "array"
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "timeline": {
            "items": {
              "$ref": "#/components/schemas/TimelineEvent"
            },
            "type": "array"
          },
          "findings": {
            "description": "`findings` are what the Peppol rules say about the document, present when they have been asked: after validate, or a send they refused.",
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "type": "array"
          },
          "attachments": {
            "description": "`attachments` are the files of the document, each fetched by its index from .../attachments/{index} when it is embedded.",
            "items": {
              "$ref": "#/components/schemas/DocumentAttachment"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "direction",
          "type",
          "state",
          "number",
          "issueDate",
          "currency",
          "payableAmount",
          "counterparty",
          "createdAt",
          "updatedAt",
          "document",
          "validation",
          "totals",
          "timeline",
          "attachments"
        ],
        "type": "object"
      },
      "DocumentAttachment": {
        "properties": {
          "index": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "url": {
            "description": "`url` is where the file is, when it is linked to and not embedded.",
            "type": "string"
          },
          "embedded": {
            "type": "boolean"
          },
          "size": {
            "description": "`size` is the embedded file's size in bytes.",
            "type": "integer"
          }
        },
        "required": [
          "index",
          "embedded"
        ],
        "type": "object"
      },
      "DocumentContent": {
        "description": "`DocumentContent` is an invoice or a credit note as clients write it. Totals are not part of it: they are computed, see Totals.",
        "properties": {
          "document_type": {
            "enum": [
              "INVOICE",
              "CREDIT_NOTE",
              "DEBIT_NOTE",
              "PREPAYMENT_INVOICE",
              "SELF_BILLING_INVOICE",
              "SELF_BILLING_CREDIT_NOTE"
            ],
            "type": "string"
          },
          "type_code": {
            "description": "`type_code` is the UNCL1001 code (BT-3), for the rarer kinds that have no document type of their own; empty means the type's default.",
            "type": "string"
          },
          "number": {
            "description": "EN 16931 BT-1",
            "type": "string"
          },
          "issue_date": {
            "description": "EN 16931 BT-2",
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "tax_point_date": {
            "description": "`tax_point_date` (BT-7) is when VAT becomes chargeable if that is not the issue date. `tax_point_code` (BT-8, UNCL2005) names the date by its kind instead; a document has one or the other.",
            "type": "string"
          },
          "tax_point_code": {
            "type": "string"
          },
          "currency": {
            "description": "EN 16931 BT-5",
            "type": "string"
          },
          "tax_currency": {
            "description": "`tax_currency` (BT-6) is the currency VAT is accounted in when that is not the invoice currency; `tax_amount_in_tax_currency` (BT-111) is then the total VAT in it, which only the issuer knows the exchange rate for.",
            "type": "string"
          },
          "tax_amount_in_tax_currency": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "buyer_reference": {
            "description": "One of `buyer_reference` and `order_reference` is required by Peppol.",
            "type": "string"
          },
          "order_reference": {
            "description": "EN 16931 BT-13",
            "type": "string"
          },
          "sales_order_reference": {
            "description": "EN 16931 BT-14",
            "type": "string"
          },
          "contract_reference": {
            "description": "EN 16931 BT-12",
            "type": "string"
          },
          "project_reference": {
            "description": "EN 16931 BT-11",
            "type": "string"
          },
          "receipt_reference": {
            "description": "EN 16931 BT-15, the receiving advice",
            "type": "string"
          },
          "despatch_reference": {
            "description": "EN 16931 BT-16",
            "type": "string"
          },
          "tender_reference": {
            "description": "EN 16931 BT-17",
            "type": "string"
          },
          "object_reference": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              }
            ],
            "description": "EN 16931 BT-18, what the invoice is about"
          },
          "accounting_reference": {
            "description": "`accounting_reference` (BT-19) is where the buyer books the invoice.",
            "type": "string"
          },
          "billing_references": {
            "description": "`billing_references` (BG-3) name the invoices a credit note credits, or an invoice corrects.",
            "items": {
              "$ref": "#/components/schemas/BillingReference"
            },
            "type": "array"
          },
          "note": {
            "description": "EN 16931 BT-22",
            "type": "string"
          },
          "period": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Period"
              }
            ],
            "description": "EN 16931 BG-14"
          },
          "seller": {
            "$ref": "#/components/schemas/Party"
          },
          "buyer": {
            "$ref": "#/components/schemas/Party"
          },
          "payee": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Payee"
              }
            ],
            "description": "EN 16931 BG-10, when not the seller"
          },
          "tax_representative": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxRepresentative"
              }
            ],
            "description": "EN 16931 BG-11"
          },
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Delivery"
              }
            ],
            "description": "EN 16931 BG-13"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Line"
            },
            "type": "array"
          },
          "allowances": {
            "description": "EN 16931 BG-20",
            "items": {
              "$ref": "#/components/schemas/AllowanceCharge"
            },
            "type": "array"
          },
          "charges": {
            "description": "EN 16931 BG-21",
            "items": {
              "$ref": "#/components/schemas/AllowanceCharge"
            },
            "type": "array"
          },
          "prepaid_amount": {
            "description": "`prepaid_amount` (BT-113) has been paid already; `rounding_amount` (BT-114) rounds what remains to an amount that can be paid.",
            "type": "number"
          },
          "rounding_amount": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "attachments": {
            "description": "EN 16931 BG-24",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "type": "array"
          }
        },
        "required": [
          "document_type",
          "number",
          "issue_date",
          "currency",
          "seller",
          "buyer",
          "lines"
        ],
        "type": "object"
      },
      "DocumentInShort": {
        "properties": {
          "type": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "issueDate": {
            "type": "string"
          },
          "dueDate": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "seller": {
            "type": "string"
          },
          "buyer": {
            "type": "string"
          },
          "lines": {
            "type": "integer"
          },
          "payableAmount": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "number",
          "issueDate",
          "currency",
          "seller",
          "buyer",
          "lines",
          "payableAmount"
        ],
        "type": "object"
      },
      "DocumentResponse": {
        "description": "`DocumentResponse` is what one party said of a document to the other.",
        "properties": {
          "code": {
            "description": "`code` is the status: AB, IP, UQ, CA, RE, AP or PD.",
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "sent": {
            "description": "`sent` says the company sent it; otherwise it was received.",
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "at",
          "sent"
        ],
        "type": "object"
      },
      "DocumentSummary": {
        "description": "`DocumentSummary` is a document as lists show it.",
        "properties": {
          "id": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "INVOICE",
              "CREDIT_NOTE",
              "DEBIT_NOTE",
              "PREPAYMENT_INVOICE",
              "SELF_BILLING_INVOICE",
              "SELF_BILLING_CREDIT_NOTE"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "draft",
              "queued",
              "sending",
              "delivered",
              "unconfirmed",
              "invalid",
              "failed",
              "received"
            ],
            "type": "string"
          },
          "source": {
            "description": "`source` is \"ubl\" for a document uploaded as finished UBL.",
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "issueDate": {
            "type": "string"
          },
          "dueDate": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "payableAmount": {
            "type": "string"
          },
          "counterparty": {
            "$ref": "#/components/schemas/Counterparty"
          },
          "error": {
            "description": "`error` says why a failed or unconfirmed document is in that state.",
            "type": "string"
          },
          "warnings": {
            "description": "`warnings` are what looked wrong about a received document when it arrived, for a person to judge before paying: a sender that is not the seller, a new account, a repeated number. A draft read from another format has totals_recomputed when its totals, computed, came to otherwise than the file stated.",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          },
          "response": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentResponse"
              }
            ],
            "description": "`response` is the latest Invoice `response` about the document: sent by the company about a received one, or received about a sent one."
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "type",
          "state",
          "number",
          "issueDate",
          "currency",
          "payableAmount",
          "counterparty",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "Export": {
        "description": "`Export` is the company's archive written out as zip files.",
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "description": "`state` is pending, running (parts are being written), ready or failed.",
            "type": "string"
          },
          "direction": {
            "description": "`direction`, `from` and `to` are what the export was narrowed to.",
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "pdf": {
            "description": "`pdf` says the documents are drawn as pages too.",
            "type": "boolean"
          },
          "documents": {
            "description": "`documents` is how many are written so far.",
            "type": "integer"
          },
          "parts": {
            "description": "`parts` are the zip files, fetched from /exports/{id}/parts/{number} once the export is ready. A large archive comes in several.",
            "items": {
              "$ref": "#/components/schemas/ExportPart"
            },
            "type": "array"
          },
          "error": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "completedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "state",
          "pdf",
          "documents",
          "parts",
          "createdAt"
        ],
        "type": "object"
      },
      "ExportInput": {
        "description": "`ExportInput` says which documents an export is of. Every document but drafts, which are not in the archive yet, unless narrowed.",
        "properties": {
          "direction": {
            "description": "`direction` is inbound or outbound; empty is both.",
            "type": "string"
          },
          "from": {
            "description": "`from` and `to` bound the issue date, inclusive, as YYYY-MM-DD.",
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "pdf": {
            "description": "`pdf` draws each document as pages too, in the company's language.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ExportPart": {
        "description": "`ExportPart` is one zip file of an export: in it, a folder per document with its XML as sent or received, any earlier failed sends, its pages as PDF and its files, and index.csv and index.json listing them.",
        "properties": {
          "number": {
            "type": "integer"
          },
          "documents": {
            "type": "integer"
          },
          "size": {
            "type": "integer"
          }
        },
        "required": [
          "number",
          "documents",
          "size"
        ],
        "type": "object"
      },
      "FieldError": {
        "description": "`FieldError` is a problem with one field of a document. Path is the field's place in the JSON, such as \"lines[0].vat.rate\"; Rule is the EN 16931 or Peppol rule the problem would break, where there is one.",
        "properties": {
          "path": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "type": "object"
      },
      "FileUpload": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          }
        },
        "required": [
          "filename",
          "mime",
          "description",
          "size"
        ],
        "type": "object"
      },
      "Finding": {
        "description": "`Finding` is one result of validating a document against the Peppol rules.",
        "properties": {
          "severity": {
            "description": "`severity` is \"fatal\" for what makes the document invalid, \"warning\" for what does not.",
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "layer": {
            "description": "`layer` is \"schema\" when the document does not even follow the XML schema, in which case the business rules have not been run.",
            "type": "string"
          }
        },
        "required": [
          "severity",
          "rule",
          "location",
          "message",
          "layer"
        ],
        "type": "object"
      },
      "ForwardRequest": {
        "description": "`ForwardRequest` asks for a received document to be mailed on.",
        "properties": {
          "emails": {
            "description": "`emails` are where to mail it; the company's forwarding addresses when left out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "emails"
        ],
        "type": "object"
      },
      "Identifier": {
        "description": "`Identifier` is a value in a named scheme, such as a GLN (scheme 0088).",
        "properties": {
          "scheme": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "type": "object"
      },
      "Import": {
        "description": "`Import` is a file drafts are made from.",
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "description": "`state` is pending while the drafts are made, then done or failed.",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "kind": {
            "description": "`kind` is spreadsheet, pages (a PDF or image read by a model) or document (an e-invoice).",
            "type": "string"
          },
          "documents": {
            "description": "`documents` are the ids of the drafts made, one an invoice.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "problems": {
            "description": "`problems` are what could not be read, by row for a spreadsheet; the invoices of the other rows are made all the same.",
            "items": {
              "$ref": "#/components/schemas/ImportProblem"
            },
            "type": "array"
          },
          "error": {
            "description": "`error` says why nothing could be made, when the import failed.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "state",
          "kind",
          "documents",
          "problems",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ImportProblem": {
        "description": "`ImportProblem` is something an import could not read.",
        "properties": {
          "row": {
            "description": "`row` is the spreadsheet's row, the header being row 1.",
            "type": "integer"
          },
          "column": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "ImportUploadRequest": {
        "description": "`ImportUploadRequest` asks where to put a file too large to send to the API itself.",
        "properties": {
          "contentType": {
            "type": "string"
          },
          "size": {
            "description": "`size` is the file's, in bytes.",
            "type": "integer"
          }
        },
        "required": [
          "contentType",
          "size"
        ],
        "type": "object"
      },
      "Line": {
        "properties": {
          "id": {
            "description": "EN 16931 BT-126",
            "type": "string"
          },
          "note": {
            "description": "EN 16931 BT-127",
            "type": "string"
          },
          "name": {
            "description": "`name` is what is sold (BT-153); `description` says more about it (BT-154).",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "description": "EN 16931 BT-129",
            "type": "number"
          },
          "unit": {
            "description": "`unit` is a UN/ECE Recommendation 20 code; C62 (\"one\") when empty.",
            "type": "string"
          },
          "unit_price": {
            "description": "`unit_price` is the net price (BT-146): after any discount, before VAT, for `price_base_quantity` units (BT-149), which is 1 when not given.",
            "type": "number"
          },
          "price_base_quantity": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "gross_price": {
            "description": "`gross_price` (BT-148) is the price before discount, shown for information; the discount (BT-147) is its difference from `unit_price`.",
            "type": "number"
          },
          "allowances": {
            "description": "EN 16931 BG-27",
            "items": {
              "$ref": "#/components/schemas/Adjustment"
            },
            "type": "array"
          },
          "charges": {
            "description": "EN 16931 BG-28",
            "items": {
              "$ref": "#/components/schemas/Adjustment"
            },
            "type": "array"
          },
          "vat": {
            "$ref": "#/components/schemas/VAT"
          },
          "period": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Period"
              }
            ],
            "description": "EN 16931 BG-26"
          },
          "order_line_reference": {
            "description": "EN 16931 BT-132",
            "type": "string"
          },
          "accounting_reference": {
            "description": "EN 16931 BT-133",
            "type": "string"
          },
          "object_reference": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              }
            ],
            "description": "EN 16931 BT-128"
          },
          "item_code": {
            "description": "EN 16931 BT-155, the seller's",
            "type": "string"
          },
          "buyer_item_code": {
            "description": "EN 16931 BT-156",
            "type": "string"
          },
          "standard_item_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              }
            ],
            "description": "EN 16931 BT-157, such as a GTIN"
          },
          "classifications": {
            "description": "EN 16931 BT-158",
            "items": {
              "$ref": "#/components/schemas/Classification"
            },
            "type": "array"
          },
          "origin_country": {
            "description": "EN 16931 BT-159",
            "type": "string"
          },
          "attributes": {
            "description": "EN 16931 BG-32",
            "items": {
              "$ref": "#/components/schemas/Attribute"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "quantity",
          "unit_price",
          "vat"
        ],
        "type": "object"
      },
      "Onboarding": {
        "description": "`Onboarding` is a link to where the company's own people verify it.",
        "properties": {
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "expiresAt"
        ],
        "type": "object"
      },
      "Participant": {
        "description": "`Participant` is a company on the Peppol network.",
        "properties": {
          "peppolId": {
            "description": "`peppolId` is scheme:value, such as 0007:5561234567.",
            "type": "string"
          },
          "registered": {
            "description": "`registered` is whether anything is registered under the ID. A search for an ID that nobody has answers with it, not registered.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "invoice": {
            "description": "What the company has said it receives.",
            "type": "boolean"
          },
          "creditNote": {
            "type": "boolean"
          },
          "selfBillingInvoice": {
            "type": "boolean"
          },
          "selfBillingCreditNote": {
            "type": "boolean"
          },
          "documentTypes": {
            "description": "`documentTypes` are the identifiers of everything it receives.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "peppolId",
          "registered",
          "invoice",
          "creditNote",
          "selfBillingInvoice",
          "selfBillingCreditNote",
          "documentTypes"
        ],
        "type": "object"
      },
      "Party": {
        "properties": {
          "name": {
            "description": "`name` is the legal name (BT-27, BT-44); `trading_name` is the name the party is known by, when that differs (BT-28, BT-45).",
            "type": "string"
          },
          "trading_name": {
            "type": "string"
          },
          "identifiers": {
            "description": "`identifiers` (BT-29, BT-46) are other ways the party is identified. A buyer has at most one.",
            "items": {
              "$ref": "#/components/schemas/Identifier"
            },
            "type": "array"
          },
          "registration_id": {
            "description": "`registration_id` is the legal registration number (BT-30, BT-47), such as an organisation number, in `registration_scheme` if that is given.",
            "type": "string"
          },
          "registration_scheme": {
            "type": "string"
          },
          "tax_id": {
            "description": "`tax_id` is the VAT number with its country prefix (BT-31, BT-48).",
            "type": "string"
          },
          "tax_registration": {
            "description": "`tax_registration` (BT-32, seller only) is a local tax registration, or a reference to one: in Sweden \"GODKÄND FÖR F-SKATT\".",
            "type": "string"
          },
          "legal_info": {
            "description": "`legal_info` (BT-33, seller only) is what law requires stated, such as share capital or registered office.",
            "type": "string"
          },
          "peppol_id": {
            "description": "`peppol_id` is the party's electronic address, as scheme:value.",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "contact": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "peppol_id",
          "address"
        ],
        "type": "object"
      },
      "Payee": {
        "description": "`Payee` receives the payment when that is not the seller.",
        "properties": {
          "name": {
            "type": "string"
          },
          "identifier": {
            "$ref": "#/components/schemas/Identifier"
          },
          "registration_id": {
            "type": "string"
          },
          "registration_scheme": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Payment": {
        "description": "`Payment` says how the invoice is to be paid.",
        "properties": {
          "means_code": {
            "description": "`means_code` is a UNCL4461 code (BT-81); 30, credit transfer, when empty. `means_text` (BT-82) says it in words.",
            "type": "string"
          },
          "means_text": {
            "type": "string"
          },
          "reference": {
            "description": "`reference` (BT-83) is what the payer quotes so the payment is matched.",
            "type": "string"
          },
          "terms": {
            "description": "EN 16931 BT-20",
            "type": "string"
          },
          "accounts": {
            "description": "`accounts` (BG-17) are where a credit transfer goes.",
            "items": {
              "$ref": "#/components/schemas/Account"
            },
            "type": "array"
          },
          "card": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Card"
              }
            ],
            "description": "EN 16931 BG-18"
          },
          "direct_debit": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DirectDebit"
              }
            ],
            "description": "EN 16931 BG-19"
          }
        },
        "type": "object"
      },
      "Period": {
        "properties": {
          "start_date": {
            "type": "string"
          },
          "end_date": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Problem": {
        "description": "`Problem` is an RFC 9457 problem document. Code is the stable value for clients to branch on; Field names the input a validation failure is about.",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail"
        ],
        "type": "object"
      },
      "ReceivingRequest": {
        "description": "Types the handlers read that are worth a name.",
        "properties": {
          "receive": {
            "description": "`receive` publishes the company on the network as a receiver of invoices, credit notes and Invoice Responses; false has it only send.",
            "type": "boolean"
          }
        },
        "required": [
          "receive"
        ],
        "type": "object"
      },
      "ResponseInput": {
        "description": "`ResponseInput` is what the company says of a received document.",
        "properties": {
          "code": {
            "description": "`code` is the status: AB, IP, UQ, CA, RE, AP or PD.",
            "type": "string"
          },
          "reasonCode": {
            "description": "`reasonCode` and `reason` say why; a query, a condition or a rejection must give a reason code.",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "effectiveDate": {
            "description": "`effectiveDate` is when the status took effect, such as the day paid.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "reasonCode",
          "reason",
          "effectiveDate"
        ],
        "type": "object"
      },
      "Scheme": {
        "description": "`Scheme` is an identifier scheme a company in a country is known by.",
        "properties": {
          "id": {
            "description": "`id` is the scheme's code in the endpoint scheme list, such as \"0007\".",
            "type": "string"
          },
          "label": {
            "description": "`label` names the identifier as its holders know it.",
            "type": "string"
          },
          "vat": {
            "description": "`vat` marks a scheme whose identifier is the VAT number, written with its country prefix.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "type": "object"
      },
      "TaxRepresentative": {
        "description": "`TaxRepresentative` accounts for the seller's VAT where the seller cannot.",
        "properties": {
          "name": {
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "required": [
          "name",
          "tax_id",
          "address"
        ],
        "type": "object"
      },
      "TimelineEvent": {
        "properties": {
          "at": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "at",
          "event"
        ],
        "type": "object"
      },
      "ToolPreview": {
        "description": "`ToolPreview` is what a document someone is filling in comes to: its totals, and what is wrong with it as an e-invoice.",
        "properties": {
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "validation": {
            "items": {
              "$ref": "#/components/schemas/FieldError"
            },
            "type": "array"
          }
        },
        "required": [
          "totals",
          "validation"
        ],
        "type": "object"
      },
      "ToolRead": {
        "description": "`ToolRead` is a document read for showing: its content as the portal's model, the totals as the document states them, and its attachments by name.",
        "properties": {
          "format": {
            "description": "`format` is what the document was written in: ubl, cii, factur-x or fatturapa.",
            "type": "string"
          },
          "document": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentContent"
              }
            ],
            "description": "`document` is the content; the attachments' content is left out."
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/DocumentAttachment"
            },
            "type": "array"
          }
        },
        "required": [
          "format",
          "document",
          "totals",
          "attachments"
        ],
        "type": "object"
      },
      "ToolValidation": {
        "description": "`ToolValidation` is what the free validator says of a document.",
        "properties": {
          "format": {
            "description": "`format` is what the document was written in: ubl, cii, factur-x or fatturapa.",
            "type": "string"
          },
          "unreadable": {
            "description": "`unreadable` says why the document could not be read at all.",
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "rulesChecked": {
            "description": "`rulesChecked` says whether the Peppol rules were asked; a document with field errors, or larger than 512 kB, is not.",
            "type": "boolean"
          },
          "validation": {
            "items": {
              "$ref": "#/components/schemas/FieldError"
            },
            "type": "array"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "type": "array"
          },
          "summary": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentInShort"
              }
            ],
            "description": "`summary` is the document in short, for showing."
          },
          "recomputed": {
            "description": "`recomputed` are the totals of a document in another format that come to otherwise, computed the way EN 16931 prescribes, than it states: written as Peppol BIS, the computed ones are.",
            "items": {
              "$ref": "#/components/schemas/Difference"
            },
            "type": "array"
          }
        },
        "required": [
          "format",
          "valid",
          "rulesChecked",
          "validation",
          "findings"
        ],
        "type": "object"
      },
      "Totals": {
        "properties": {
          "lineExtensionAmount": {
            "type": "string"
          },
          "allowanceTotalAmount": {
            "type": "string"
          },
          "chargeTotalAmount": {
            "type": "string"
          },
          "taxExclusiveAmount": {
            "type": "string"
          },
          "taxAmount": {
            "type": "string"
          },
          "taxInclusiveAmount": {
            "type": "string"
          },
          "prepaidAmount": {
            "type": "string"
          },
          "roundingAmount": {
            "type": "string"
          },
          "payableAmount": {
            "type": "string"
          },
          "lineAmounts": {
            "description": "`lineAmounts` is each line's net amount, in line order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "vat": {
            "items": {
              "$ref": "#/components/schemas/VatSubtotal"
            },
            "type": "array"
          }
        },
        "required": [
          "lineExtensionAmount",
          "allowanceTotalAmount",
          "chargeTotalAmount",
          "taxExclusiveAmount",
          "taxAmount",
          "taxInclusiveAmount",
          "prepaidAmount",
          "roundingAmount",
          "payableAmount",
          "lineAmounts",
          "vat"
        ],
        "type": "object"
      },
      "VAT": {
        "properties": {
          "category": {
            "description": "`category` is a UNCL5305 code: S, Z, E, AE, K, G, O, L, M or B.",
            "type": "string"
          },
          "rate": {
            "description": "A decimal number, with the decimals it has.",
            "type": "number"
          },
          "exemption_reason_code": {
            "description": "`exemption_reason_code` (BT-121, a VATEX code) and `exemption_reason` (BT-120) say why no VAT is charged. One of them is required for categories E, AE, K, G and O, and neither is allowed for the others.",
            "type": "string"
          },
          "exemption_reason": {
            "type": "string"
          }
        },
        "required": [
          "category",
          "rate"
        ],
        "type": "object"
      },
      "VATRates": {
        "description": "`VATRates` are the VAT rates in use in a country. They are offered as suggestions and never enforced: rates change, regions and special regimes have their own, and the invoice is its issuer's to get right.",
        "properties": {
          "standard": {
            "description": "`standard` is the standard rate, followed by any regional standard rate.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "other": {
            "description": "`other` is every reduced, super-reduced, parking and zero rate, highest first.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "standard",
          "other"
        ],
        "type": "object"
      },
      "Validation": {
        "properties": {
          "valid": {
            "description": "`valid` says the document has no field errors and breaks no rule that was checked.",
            "type": "boolean"
          },
          "rulesChecked": {
            "description": "`rulesChecked` says whether the Peppol rules were asked. They are not for a document with field errors, which come first.",
            "type": "boolean"
          },
          "validation": {
            "description": "`validation` lists the field errors of a document given as JSON.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            },
            "type": "array"
          },
          "findings": {
            "description": "`findings` are what the Peppol rules say.",
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "type": "array"
          },
          "unreadable": {
            "description": "`unreadable` says why a document given as UBL could not be read.",
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "ubl": {
            "description": "`ubl` is the document as UBL, when it was given as JSON and has no field errors.",
            "type": "string"
          }
        },
        "required": [
          "valid",
          "rulesChecked",
          "validation",
          "findings"
        ],
        "type": "object"
      },
      "VatCheck": {
        "description": "`VatCheck` is what VIES says of a number.",
        "properties": {
          "countryCode": {
            "type": "string"
          },
          "vatNumber": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          },
          "name": {
            "description": "`name` and `address` are the holder's, where the member state gives them.",
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "checkedAt": {
            "description": "`checkedAt` is when VIES answered.",
            "type": "string"
          }
        },
        "required": [
          "countryCode",
          "vatNumber",
          "valid",
          "checkedAt"
        ],
        "type": "object"
      },
      "VatSubtotal": {
        "properties": {
          "category": {
            "type": "string"
          },
          "rate": {
            "type": "string"
          },
          "exemptionReasonCode": {
            "type": "string"
          },
          "exemptionReason": {
            "type": "string"
          },
          "taxableAmount": {
            "type": "string"
          },
          "taxAmount": {
            "type": "string"
          }
        },
        "required": [
          "category",
          "rate",
          "taxableAmount",
          "taxAmount"
        ],
        "type": "object"
      },
      "Verification": {
        "description": "`Verification` is where a company is in being verified by the access point: a company that has not been waits before it is on Peppol.",
        "properties": {
          "needed": {
            "description": "`needed` says the company waits to be verified. A company in test mode needs not be.",
            "type": "boolean"
          },
          "status": {
            "description": "`status` is NOT_STARTED, PENDING_SIGNATURES (the agreement is out to be signed), MANUAL_REVIEW, VERIFIED, REJECTED, EXPIRED or WITHDRAWN; empty where there is nothing to verify.",
            "type": "string"
          }
        },
        "required": [
          "needed"
        ],
        "type": "object"
      },
      "Warning": {
        "description": "`Warning` is one thing that looked wrong about a received document.",
        "properties": {
          "code": {
            "description": "`code` is for programs: sender_mismatch, new_supplier, new_account, duplicate_number, due_date_passed, or totals_recomputed on a draft.",
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "Watch": {
        "description": "`Watch` is a party the company waits for on the Peppol network.",
        "properties": {
          "id": {
            "type": "string"
          },
          "peppolId": {
            "description": "`peppolId` is the id watched, as scheme:value.",
            "type": "string"
          },
          "name": {
            "description": "`name` is what the company calls the party.",
            "type": "string"
          },
          "email": {
            "description": "`email` is where the company is told when the party appears.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "checkedAt": {
            "description": "`checkedAt` is when the network was last asked.",
            "type": "string"
          },
          "found": {
            "description": "`found` says the party is registered now: since `foundAt`, as `registeredName`, receiving `receives` (invoice, credit-note, ...).",
            "type": "boolean"
          },
          "foundAt": {
            "type": "string"
          },
          "registeredName": {
            "type": "string"
          },
          "receives": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "peppolId",
          "createdAt",
          "found",
          "receives"
        ],
        "type": "object"
      },
      "WatchRequest": {
        "description": "`WatchRequest` puts a watch on a party.",
        "properties": {
          "peppolId": {
            "description": "`peppolId` is the id to wait for, as scheme:value.",
            "type": "string"
          },
          "name": {
            "description": "`name` is what the company calls the party, for its own reading.",
            "type": "string"
          },
          "email": {
            "description": "`email` is where to be told when the party appears; nobody is mailed when left out, and the webhooks are told either way.",
            "type": "string"
          }
        },
        "required": [
          "peppolId"
        ],
        "type": "object"
      },
      "Webhook": {
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "description": "`events` are the event types delivered; empty means all of them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "secret": {
            "description": "`secret` signs every delivery: the X-Portal-Signature header holds t=\u003cunix time\u003e,v1=\u003cHMAC-SHA256 of \"\u003cunix time\u003e.\u003cbody\u003e\" in hex\u003e.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "secret",
          "createdAt"
        ],
        "type": "object"
      },
      "WebhookDelivery": {
        "properties": {
          "eventId": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "attempt": {
            "type": "integer"
          },
          "at": {
            "type": "string"
          },
          "delivered": {
            "type": "boolean"
          },
          "status": {
            "description": "`status` is the HTTP status the receiver answered with, if it answered.",
            "type": "integer"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "eventId",
          "event",
          "attempt",
          "at",
          "delivered"
        ],
        "type": "object"
      },
      "WebhookDocument": {
        "description": "`WebhookDocument` is the data of a document event: enough to know what happened to which document, and its id to fetch the rest.",
        "properties": {
          "id": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "state": {
            "enum": [
              "draft",
              "queued",
              "sending",
              "delivered",
              "unconfirmed",
              "invalid",
              "failed",
              "received"
            ],
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "issue_date": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "payable_amount": {
            "type": "string"
          },
          "counterparty": {
            "properties": {
              "name": {
                "type": "string"
              },
              "peppol_id": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "peppol_id"
            ],
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "warnings": {
            "description": "`warnings` are what looked wrong about a received document.",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          },
          "response": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentResponse"
              }
            ],
            "description": "`response` is the latest Invoice `response` about the document."
          }
        },
        "required": [
          "id",
          "direction",
          "type",
          "state",
          "number",
          "issue_date",
          "currency",
          "payable_amount",
          "counterparty"
        ],
        "type": "object"
      },
      "WebhookEvent": {
        "description": "`WebhookEvent` is what a webhook is sent.",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "enum": [
              "document.received",
              "document.sent",
              "document.failed",
              "document.unconfirmed",
              "document.response",
              "participant.registered",
              "webhook.test"
            ],
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "company_id": {
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookDocument"
              },
              {
                "$ref": "#/components/schemas/WebhookRegistered"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "company_id",
          "data"
        ],
        "type": "object"
      },
      "WebhookRegistered": {
        "description": "`WebhookRegistered` is the data of a participant.registered event: the watch that was waiting, and what was found.",
        "properties": {
          "watch_id": {
            "type": "string"
          },
          "peppol_id": {
            "type": "string"
          },
          "name": {
            "description": "`name` is what the company called the party; `registered_name` what it is registered as.",
            "type": "string"
          },
          "registered_name": {
            "type": "string"
          },
          "receives": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "watch_id",
          "peppol_id",
          "receives"
        ],
        "type": "object"
      },
      "WebhookRequest": {
        "description": "Types the handlers read that are worth a name.",
        "properties": {
          "url": {
            "description": "`url` is where events are delivered: an https address on the public internet.",
            "type": "string"
          },
          "events": {
            "description": "`events` are the event types to deliver; all of them when empty.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "enabled": {
            "description": "`enabled` is true unless given as false.",
            "type": "boolean"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "An API key, created under a company's settings or under the account.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The API of the Peppol portal: create, validate, send and receive invoices and credit notes over the Peppol network.\n\n**Signing in.** A program signs in with an API key as `Authorization: Bearer ppk_…`. A company's key, created under the company's settings, is for that company alone, so the paths here name none. An account key, created under the account, acts as the person: it reaches every company of theirs under `/v1/companies/{companyId}` and may add companies. A person signed in to the portal reaches the operations the same way.\n\n**Documents** are given and answered in JSON modelled on EN 16931, the European standard for e-invoices; the field descriptions name the standard's terms (BT-1 and so on). Amounts are numbers with the decimals they have. The portal writes the UBL, computes the totals and checks the document against the same rules the network applies.\n\n**Errors** are answered as `application/problem+json`: `code` is for programs, `detail` for people, and `field` names the field at fault where there is one.\n\n**Limits.** An API key is answered a few hundred times a minute, and an address that calls what needs no key somewhat less. Every answer says what is left in `RateLimit-Remaining`; a request too many is answered 429 with `Retry-After`.\n\n**Webhooks** tell of what happens to documents. Every delivery is signed: the `X-Portal-Signature` header holds `t=\u003cunix time\u003e,v1=\u003csignature\u003e`, where the signature is the HMAC-SHA256, in hex, of `\u003cunix time\u003e.\u003cbody\u003e` under the webhook's secret. Answer with a 2xx status within ten seconds; a delivery that fails is tried again after 1, 5 and 15 minutes.",
    "title": "Peppol portal API",
    "version": "1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/account/api-keys": {
      "get": {
        "description": "Not for API keys.",
        "operationId": "listTheAccountSKeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "apiKeys": {
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List the account's keys",
        "tags": [
          "Account"
        ]
      },
      "post": {
        "description": "An account key acts as the person: it reaches every company of theirs under `/v1/companies/{companyId}`, may add companies, and may not make keys. The key itself is in the answer, and nowhere after it. Not for API keys.",
        "operationId": "createAnAccountKey",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "apiKey": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create an account key",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/api-keys/{id}": {
      "delete": {
        "operationId": "revokeAnAccountKey",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Revoke an account key",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/audit": {
      "get": {
        "description": "Changes to the account itself that are about no one company, such as its account keys, newest first. Each company's own are under its `/audit`.",
        "operationId": "whatWasDoneToTheAccount",
        "parameters": [
          {
            "description": "How many, at most 200; 50 when left out.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Continue after an earlier page, from its `nextCursor`.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "entries": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "What was done to the account",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/balance": {
      "get": {
        "description": "How many documents the account has sent this month, how many its plan includes, and, beyond them, the price of each or, on a plan with a cap, what is left. Plans and payment are the account's in the SaaS kit. For a company's key, the account that added the company.",
        "operationId": "getTheMonthAgainstThePlan",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "balance": {
                      "$ref": "#/components/schemas/Balance"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get the month against the plan",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/usage": {
      "get": {
        "description": "How many documents each of the caller's companies sent and received, over the last thirty days unless `from` and `to` say otherwise.",
        "operationId": "getUsageForEveryCompany",
        "parameters": [
          {
            "description": "The first day, as YYYY-MM-DD.",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The last day, as YYYY-MM-DD.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "companies": {
                      "items": {
                        "properties": {
                          "companyId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "peppolId": {
                            "type": "string"
                          },
                          "received": {
                            "type": "integer"
                          },
                          "sent": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "from": {
                      "type": "string"
                    },
                    "received": {
                      "type": "integer"
                    },
                    "sent": {
                      "type": "integer"
                    },
                    "to": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get usage for every company",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/audit": {
      "get": {
        "description": "Every change made to the company and its documents, keys, webhooks and settings, through the API or the web app, newest first: what was done, to what, by whom (a person, by their user id, or an API key, by its id), and from where. Reading is not recorded. `nextCursor` continues the list.",
        "operationId": "whatWasDoneToTheCompany",
        "parameters": [
          {
            "description": "How many, at most 200; 50 when left out.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Continue after an earlier page, from its `nextCursor`.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "entries": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "What was done to the company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/codes": {
      "get": {
        "description": "The code lists and reference data a client needs to offer the choices a document has: the same data documents are validated against.",
        "operationId": "getTheCodeLists",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "allowanceReasons": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "chargeReasons": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "countries": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "creditNoteTypes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "currencies": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "endpointSchemes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "identifierSchemes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "internationalSchemes": {
                      "items": {
                        "$ref": "#/components/schemas/Scheme"
                      },
                      "type": "array"
                    },
                    "invoiceTypes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "itemIdTypes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "mimeTypes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "paymentMeans": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "referenceTypes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "schemesByCountry": {
                      "additionalProperties": {
                        "items": {
                          "$ref": "#/components/schemas/Scheme"
                        },
                        "type": "array"
                      },
                      "type": "object"
                    },
                    "taxPointCodes": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "units": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "vatCategories": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "vatExemptions": {
                      "items": {
                        "$ref": "#/components/schemas/Code"
                      },
                      "type": "array"
                    },
                    "vatRates": {
                      "additionalProperties": {
                        "$ref": "#/components/schemas/VATRates"
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Get the code lists",
        "tags": [
          "Reference data"
        ]
      }
    },
    "/v1/companies": {
      "post": {
        "description": "Registers the company on the Peppol network, to send and to receive. Not for API keys.",
        "operationId": "addACompany",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "company": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Add a company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{companyId}/api-keys": {
      "get": {
        "description": "Not for API keys.",
        "operationId": "listAPIKeys",
        "parameters": [
          {
            "description": "The company's id.",
            "in": "path",
            "name": "companyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "apiKeys": {
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List API keys",
        "tags": [
          "Companies"
        ]
      },
      "post": {
        "description": "The key itself is in the answer, and nowhere after it. Not for API keys.",
        "operationId": "createAnAPIKey",
        "parameters": [
          {
            "description": "The company's id.",
            "in": "path",
            "name": "companyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "apiKey": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create an API key",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{companyId}/api-keys/{id}": {
      "delete": {
        "operationId": "revokeAnAPIKey",
        "parameters": [
          {
            "description": "The company's id.",
            "in": "path",
            "name": "companyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Revoke an API key",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}": {
      "get": {
        "operationId": "getACompany",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "company": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}/receiving": {
      "put": {
        "description": "With `receive` true the company is published on the Peppol network as a receiver of invoices, credit notes and Invoice Responses, and what is sent to it arrives here. With false it only sends, and is not found as a receiver: for a company that receives through another access point, or not at all. A company being set up at the access point answers 409 `NOT_PROVISIONED`.",
        "operationId": "receiveThroughThePortalOrOnlySend",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceivingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "company": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Receive through the portal, or only send",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}/settings": {
      "put": {
        "operationId": "replaceACompanySSettings",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanySettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "company": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Replace a company's settings",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}/verification": {
      "get": {
        "description": "A company is on the Peppol network once the access point has verified that it controls the legal entity its identifier names: a register extract and an agreement signed by those who may bind it. Until then its Peppol ID waits (status PENDING_APPROVAL), and `needed` is true. A company in test mode is never verified, and needs not be.",
        "operationId": "whereTheCompanyIsInBeingVerified",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "verification": {
                      "$ref": "#/components/schemas/Verification"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Where the company is in being verified",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}/verification/onboarding-link": {
      "post": {
        "description": "A link to the access point's page where the company's own people upload its register extract and choose who signs the agreement. It works for 30 days, any number of times, and is ended by the next. 409 `NOTHING_TO_VERIFY` for a company in test mode or verified already.",
        "operationId": "getALinkToVerifyTheCompany",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "onboarding": {
                      "$ref": "#/components/schemas/Onboarding"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a link to verify the company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/documents": {
      "get": {
        "description": "A page of the company's documents. A page may hold fewer documents than asked for and still have a `nextCursor`; the listing ends when there is none.",
        "operationId": "listDocuments",
        "parameters": [
          {
            "description": "Only documents `inbound` (received) or `outbound` (the company's own).",
            "in": "query",
            "name": "direction",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents in this state. Several are given with commas between them, or by repeating the parameter.",
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents of this type, such as `INVOICE` or `CREDIT_NOTE`.",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents issued on this date or later, as YYYY-MM-DD.",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents issued on this date or earlier, as YYYY-MM-DD.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents with this in their number, or in the other party's name or Peppol ID. Case is ignored.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`desc`, the default, lists the newest first; `asc` the oldest.",
            "in": "query",
            "name": "order",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many documents to answer with, at most 100. 50 when left out.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `nextCursor` of the page before, to continue after it.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "documents": {
                      "items": {
                        "$ref": "#/components/schemas/DocumentSummary"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List documents",
        "tags": [
          "Documents"
        ]
      },
      "post": {
        "description": "Stores the document as a draft. A draft may have errors: they are listed in `validation` and stop it from being sent, not from being saved. Files given in `attachments[].content` are taken out of the document and kept beside it.",
        "operationId": "createADraft",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create a draft",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/preview": {
      "post": {
        "description": "Answers with what saving the document would show, its totals and its errors, without saving it or asking the Peppol rules.",
        "operationId": "previewADocument",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Preview a document",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/ubl": {
      "post": {
        "description": "Stores a finished invoice or credit note, such as an export from a business system, as a draft. UBL (Peppol BIS Billing, XRechnung UBL and other EN 16931 UBL) is sent exactly as given. CII (XRechnung CII, ZUGFeRD and Factur-X XML), a Factur-X or ZUGFeRD PDF, and FatturaPA are read into the document model, become drafts like any written here, and are sent as Peppol BIS Billing; the answer's `validation` says what they lack, such as the receiver's Peppol ID.",
        "operationId": "createADraftFromAFile",
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "A UBL 2.1 Invoice or CreditNote, a CII CrossIndustryInvoice, a FatturaPA document, or (as application/pdf) a Factur-X or ZUGFeRD PDF.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create a draft from a file",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}": {
      "delete": {
        "operationId": "deleteADraft",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Delete a draft",
        "tags": [
          "Documents"
        ]
      },
      "get": {
        "operationId": "getADocument",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a document",
        "tags": [
          "Documents"
        ]
      },
      "put": {
        "description": "Replaces what a draft says. Its files stay as they are.",
        "operationId": "replaceADraft",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Replace a draft",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/attachments": {
      "post": {
        "description": "The body is the file, at most 4 MB, and Content-Type its type: PDF, PNG, JPEG, CSV, XLSX or ODS. A larger file is uploaded in two steps.",
        "operationId": "attachAFileToADraft",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The file's name.",
            "in": "query",
            "name": "filename",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "What the file is, for the receiver to read.",
            "in": "query",
            "name": "description",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/pdf": {
              "schema": {
                "description": "The file.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Attach a file to a draft",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/attachments/uploads": {
      "post": {
        "description": "Answers with a URL to PUT the file to, with exactly the headers given and the size stated. Once it is there, finish the upload.",
        "operationId": "startUploadingALargeFile",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "expiresAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "fileId": {
                      "type": "string"
                    },
                    "headers": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    "uploadUrl": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Start uploading a large file",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/attachments/uploads/{fileId}": {
      "post": {
        "description": "Attaches the uploaded file to the draft. What was uploaded is checked like any other file, and thrown away if refused.",
        "operationId": "finishUploadingALargeFile",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `fileId` the upload was started with.",
            "in": "path",
            "name": "fileId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Finish uploading a large file",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/attachments/{n}": {
      "delete": {
        "operationId": "removeAnAttachmentFromADraft",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The attachment's `index` in the document's `attachments`.",
            "in": "path",
            "name": "n",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Remove an attachment from a draft",
        "tags": [
          "Documents"
        ]
      },
      "get": {
        "description": "The file of the attachment with this `index` in the document's `attachments`. A file above 4 MB is answered with a redirect (303) to where it can be fetched.",
        "operationId": "downloadAnAttachment",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The attachment's `index` in the document's `attachments`.",
            "in": "path",
            "name": "n",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "description": "The file.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Download an attachment",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/credit-note": {
      "post": {
        "description": "Creates a draft credit note with the invoice's parties and lines, referring to the invoice. Its number is left to give.",
        "operationId": "createACreditNoteForASentInvoice",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create a credit note for a sent invoice",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/export/{format}": {
      "get": {
        "description": "The document written as `cii` (UN/CEFACT CII D16B in the EN 16931 profile, which Factur-X and ZUGFeRD take), `xrechnung` (the same with XRechnung 3.0's guideline, for German public buyers) or `factur-x` (a PDF/A-3 with the pages drawn and the CII inside, Factur-X 1.0 / ZUGFeRD 2 at the EN 16931 level). The amounts are the ones the UBL carries.",
        "operationId": "getADocumentInAnotherFormat",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`cii`, `xrechnung` or `factur-x`.",
            "in": "path",
            "name": "format",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The language of the pages of a Factur-X: `sv`, `en`, `de`, `fr`, `nl`, `da`, `nb`, `fi`, `it` or `es`. The company's language when left out.",
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/xml": {
                "schema": {
                  "description": "The document in the format asked for; a Factur-X as application/pdf.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a document in another format",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/forward": {
      "post": {
        "description": "Mails a received document, now, to the addresses given or else to the company's forwarding addresses: the pages drawn as PDF, the XML, the files inside it, and what looked wrong. For sending it on again, or to someone else, after the fact; the forwarding the company has set up happens by itself when a document arrives. The timeline records it.",
        "operationId": "mailAReceivedDocumentOn",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForwardRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Mail a received document on",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/pdf": {
      "get": {
        "description": "The document drawn as pages to read. The pages are a view of the e-invoice; the XML is the original.",
        "operationId": "getADocumentAsPDF",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`sv`, `en`, `de`, `fr`, `nl`, `da`, `nb`, `fi`, `it` or `es`. The company's language when left out: the one it has chosen in its settings, else its country's.",
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "description": "The document as pages.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a document as PDF",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/reopen": {
      "post": {
        "description": "Turns a document that is `failed` or `invalid` back into a draft, to be changed and sent again. What the failed send carried stays in the archive, and the timeline records it.",
        "operationId": "makeAFailedDocumentADraftAgain",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Make a failed document a draft again",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/response": {
      "post": {
        "description": "Sends a Peppol Invoice Response to whoever sent the document: `AB` acknowledged, `IP` in process, `UQ` under query, `CA` conditionally accepted, `RE` rejected, `AP` accepted or `PD` paid. A query, a condition or a rejection must give a `reasonCode` (OPStatusReason: REF, LEG, REC, QUA, DEL, PRI, QTY, ITM, PAY, UNR, FIN, PPD, OTH). The document records what was said in `response`. A response about a document the company sent arrives the other way, as the `document.response` event.",
        "operationId": "answerAReceivedDocument",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponseInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Answer a received document",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/retry": {
      "post": {
        "description": "Sends a document that is `failed` or `invalid` again, as it is, as a new message: the checks of a send are made again, and the answer is as for sending a draft. A document that is still not right to send is left a draft (the error says why), to be changed and sent. What the failed send carried stays in the archive.",
        "operationId": "sendAFailedDocumentAgain",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Send a failed document again",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/send": {
      "post": {
        "description": "Checks the draft against the Peppol rules and queues it for sending. The answer comes at once; the document then goes from `queued` to `delivered`, `unconfirmed`, `invalid` or `failed`, which a webhook tells of.",
        "operationId": "sendADraft",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Send a draft",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/ubl": {
      "get": {
        "description": "The XML that was sent or received, or that a draft would be sent as. A document above 4 MB is answered with a redirect (303) to where it can be fetched.",
        "operationId": "getADocumentAsUBL",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/xml": {
                "schema": {
                  "description": "A UBL 2.1 Invoice or CreditNote.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a document as UBL",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/validate": {
      "post": {
        "description": "Asks the Peppol rules about a stored document, without sending it. What they say is in `findings`.",
        "operationId": "validateAStoredDocument",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Validate a stored document",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/exports": {
      "get": {
        "description": "The company's exports of the last seven days, newest first.",
        "operationId": "listExports",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "exports": {
                      "items": {
                        "$ref": "#/components/schemas/Export"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List exports",
        "tags": [
          "Documents"
        ]
      },
      "post": {
        "description": "Writes the company's documents out as zip files, for it to keep: a folder per document with its XML as sent or received, what earlier failed sends of it carried, its pages as PDF when `pdf` is asked for, and its files, with `index.csv` and `index.json` listing every document and its timeline. Every document but drafts, unless narrowed by `direction` and issue date. The answer comes at once; the export is `ready` when its parts are written. A large archive comes in several parts. Exports are kept for seven days.",
        "operationId": "exportTheArchive",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "export": {
                      "$ref": "#/components/schemas/Export"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Export the archive",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/exports/{id}": {
      "get": {
        "operationId": "getAnExport",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "export": {
                      "$ref": "#/components/schemas/Export"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get an export",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/exports/{id}/parts/{n}": {
      "get": {
        "description": "The n'th zip file of a ready export, counting from 1; most often by a redirect to where it is kept.",
        "operationId": "downloadAPartOfAnExport",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The attachment's `index` in the document's `attachments`.",
            "in": "path",
            "name": "n",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "description": "A zip file of documents.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Download a part of an export",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/imports": {
      "get": {
        "operationId": "listImports",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "imports": {
                      "items": {
                        "$ref": "#/components/schemas/Import"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List imports",
        "tags": [
          "Documents"
        ]
      },
      "post": {
        "description": "Makes drafts from a file sent as the body, of its own Content-Type: a spreadsheet of invoices (CSV or Excel; see the template at `/tools/import-template/{format}`), an invoice as pages (a PDF without an e-invoice inside, or a photo or scan, read by a model, each draft saying it is to be checked and what was unclear), or an e-invoice in any format the portal reads. The answer comes at once; the import is `done` when its drafts are made, with their ids in `documents` and what could not be read in `problems`, by row. A file over 5 MB is put to a link from `/imports/uploads` first and named here by `upload`.",
        "operationId": "makeDraftsFromAFile",
        "parameters": [
          {
            "description": "The file's name, which tells a CSV file by its extension.",
            "in": "query",
            "name": "filename",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `uploadId` of a file put to a link from `/imports/uploads`, in place of a body.",
            "in": "query",
            "name": "upload",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `upload`: the file's content type.",
            "in": "query",
            "name": "contentType",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "description": "The file: CSV, .xlsx, PDF, PNG, JPEG, WebP, GIF, or XML (UBL, CII, FatturaPA).",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "import": {
                      "$ref": "#/components/schemas/Import"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Make drafts from a file",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/imports/uploads": {
      "post": {
        "description": "For a file over 5 MB, up to 20 MB: put it to `uploadUrl` with the `headers` given, then make the drafts with `POST /imports?upload={uploadId}`.",
        "operationId": "getALinkToPutALargeFileTo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "expiresAt": {
                      "type": "string"
                    },
                    "headers": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    "uploadId": {
                      "type": "string"
                    },
                    "uploadUrl": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a link to put a large file to",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/imports/{id}": {
      "get": {
        "operationId": "getAnImport",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "import": {
                      "$ref": "#/components/schemas/Import"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get an import",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getTheCallerAndItsCompanies",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "companies": {
                      "items": {
                        "$ref": "#/components/schemas/Company"
                      },
                      "type": "array"
                    },
                    "user": {
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get the caller and its companies",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/participants": {
      "get": {
        "operationId": "searchThePeppolDirectory",
        "parameters": [
          {
            "description": "A Peppol ID (`0007:5561234567`), a national number, or part of a name.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "participants": {
                      "items": {
                        "$ref": "#/components/schemas/Participant"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Search the Peppol directory",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/participants/by-vat/{number}": {
      "get": {
        "description": "The Peppol IDs the VAT number may go by (the country's VAT scheme, and its register where the register number can be read off the VAT number) are tried in turn; `participant` is the first that is registered, or null, and `tried` lists them all.",
        "operationId": "findAParticipantByVATNumber",
        "parameters": [
          {
            "description": "An EU VAT number, such as `SE556123456701`.",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "participant": {
                      "$ref": "#/components/schemas/Participant"
                    },
                    "tried": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Find a participant by VAT number",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/participants/{peppolId}": {
      "get": {
        "description": "Whether anything is registered under the ID, and what it receives.",
        "operationId": "lookUpAPeppolID",
        "parameters": [
          {
            "description": "A Peppol ID, as scheme:value, such as `0007:5561234567`.",
            "in": "path",
            "name": "peppolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "participant": {
                      "$ref": "#/components/schemas/Participant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Look up a Peppol ID",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/simulate-inbound": {
      "post": {
        "description": "For a sandbox company: delivers the UBL in the body, or a sample invoice when the body is empty, as if it had arrived over Peppol.",
        "operationId": "receiveATestDocument",
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "A UBL 2.1 Invoice or CreditNote, or nothing.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Receive a test document",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/tools/convert": {
      "post": {
        "description": "Reads a document in any of the formats and answers with it as Peppol BIS Billing 3.0 UBL, or as what `to` asks for: `cii` (EN 16931 profile), `xrechnung` (XRechnung 3.0 CII) or `factur-x` (PDF/A-3 with the CII inside). UBL asked for as UBL is answered as it is.",
        "operationId": "convertAnyEInvoiceToAnotherFormat",
        "parameters": [
          {
            "description": "`ubl` (the default), `cii`, `xrechnung` or `factur-x`.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The language of the pages of a Factur-X: `sv`, `en`, `de`, `fr`, `nl`, `da`, `nb`, `fi`, `it` or `es`; English when left out.",
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "The document; a PDF as application/pdf.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/xml": {
                "schema": {
                  "description": "The document in the format asked for; a Factur-X as application/pdf.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Convert any e-invoice to another format",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/iban/{iban}": {
      "get": {
        "description": "Whether the IBAN's length and check digits are right. Spaces are allowed.",
        "operationId": "checkAnIBAN",
        "parameters": [
          {
            "description": "An IBAN, with or without spaces.",
            "in": "path",
            "name": "iban",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "country": {
                      "type": "string"
                    },
                    "iban": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Check an IBAN",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/identifier/{scheme}/{value}": {
      "get": {
        "description": "Whether the value is a valid identifier under the scheme: a GLN under 0088, a Swedish organisation number under 0007, a Norwegian under 0192, and so on. Schemes without a known form are answered valid.",
        "operationId": "checkAnIdentifier",
        "parameters": [
          {
            "description": "An identifier scheme from the Peppol list, such as `0007` or `0088`.",
            "in": "path",
            "name": "scheme",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The identifier under the scheme.",
            "in": "path",
            "name": "value",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "scheme": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Check an identifier",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/import-template/{format}": {
      "get": {
        "description": "The spreadsheet `/imports` reads, as `csv` or `xlsx`: one row a line, the invoice's own columns on its first row, with two example invoices. The workbook's second sheet says what each column is for. Column names in Swedish are read too.",
        "operationId": "theSpreadsheetTemplateForInvoices",
        "parameters": [
          {
            "description": "`cii`, `xrechnung` or `factur-x`.",
            "in": "path",
            "name": "format",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "description": "The template.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "The spreadsheet template for invoices",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/pdf": {
      "post": {
        "description": "Reads a document in any of the formats and draws it as pages to read.",
        "operationId": "drawAnyEInvoiceAsPDF",
        "parameters": [
          {
            "description": "`sv`, `en`, `de`, `fr`, `nl`, `da`, `nb`, `fi`, `it` or `es`; English when left out.",
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "The document; a PDF as application/pdf.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "description": "The document as pages.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Draw any e-invoice as PDF",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/preview": {
      "post": {
        "description": "Takes a document as JSON, as the portal's model has it, and answers with its totals and what is wrong with it as an e-invoice. For a form to show while it is filled in; nothing is stored.",
        "operationId": "totalUpAnInvoiceBeingFilledIn",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolPreview"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Total up an invoice being filled in",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/read": {
      "post": {
        "description": "Reads a document in any of the formats and answers with its content as the portal's document model, its totals and its attachments by name, as a document in the portal is answered. For drawing it; nothing is stored.",
        "operationId": "readAnyEInvoiceForShowing",
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "The document; a PDF as application/pdf.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRead"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Read any e-invoice for showing",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/validate": {
      "post": {
        "description": "Reads an invoice or credit note as UBL, CII (XRechnung, ZUGFeRD, Factur-X), a Factur-X or ZUGFeRD PDF, or FatturaPA, and answers with what is wrong with it: its fields, and the Peppol rules where it has no field errors and is at most 512 kB.",
        "operationId": "validateAnyEInvoice",
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "The document; a PDF as application/pdf.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolValidation"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Validate any e-invoice",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/vat/{number}": {
      "get": {
        "description": "Asks the European Commission's VIES whether the number is registered, and for whom where the country says.",
        "operationId": "checkAnEUVATNumberWithVIES",
        "parameters": [
          {
            "description": "An EU VAT number, such as `SE556123456701`.",
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "vat": {
                      "$ref": "#/components/schemas/VatCheck"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Check an EU VAT number with VIES",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/tools/write": {
      "post": {
        "description": "Takes a document as JSON and answers with it as `to` says: `ubl` (Peppol BIS Billing 3.0, the default), `cii`, `xrechnung` or `factur-x`, which it must be valid to be (else 422 with the errors), or `pdf`, pages to read alone, which it may be whatever it says. Nothing is stored or sent.",
        "operationId": "writeAnInvoiceWithoutAnAccount",
        "parameters": [
          {
            "description": "`ubl` (the default), `cii`, `xrechnung`, `factur-x` or `pdf`.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The language of the pages of a PDF or Factur-X: `sv`, `en`, `de`, `fr`, `nl`, `da`, `nb`, `fi`, `it` or `es`; English when left out.",
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/xml": {
                "schema": {
                  "description": "The document in the format asked for; a Factur-X or PDF as application/pdf.",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "security": [],
        "summary": "Write an invoice without an account",
        "tags": [
          "Free tools"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "description": "How many documents the company sent and received per day, week or month, over the last thirty days unless `from` and `to` say otherwise. Only periods with any are listed; `day` is the day, the Monday the week begins on, or the month as YYYY-MM.",
        "operationId": "getUsage",
        "parameters": [
          {
            "description": "The first day, as YYYY-MM-DD.",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The last day, as YYYY-MM-DD.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`day`, the default, `week` or `month`.",
            "in": "query",
            "name": "by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "days": {
                      "items": {
                        "properties": {
                          "day": {
                            "type": "string"
                          },
                          "received": {
                            "type": "integer"
                          },
                          "sent": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "from": {
                      "type": "string"
                    },
                    "received": {
                      "type": "integer"
                    },
                    "sent": {
                      "type": "integer"
                    },
                    "to": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get usage",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/validate/json": {
      "post": {
        "description": "Answers with the document's field errors and totals and, if it has no field errors, what the Peppol rules say about it and the document as UBL. Nothing is stored or sent.",
        "operationId": "validateADocumentGivenAsJSON",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Validation"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Validate a document given as JSON",
        "tags": [
          "Validation"
        ]
      }
    },
    "/v1/validate/ubl": {
      "post": {
        "description": "Answers with what the Peppol rules say about a UBL invoice or credit note, whoever it is from. A CII, Factur-X, ZUGFeRD or FatturaPA document is read into the document model first and judged as the Peppol BIS Billing it would be sent as. Nothing is stored or sent.",
        "operationId": "validateADocumentGivenAsAFile",
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "description": "A UBL 2.1 Invoice or CreditNote, a CII CrossIndustryInvoice, a FatturaPA document, or (as application/pdf) a Factur-X or ZUGFeRD PDF.",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Validation"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Validate a document given as a file",
        "tags": [
          "Validation"
        ]
      }
    },
    "/v1/watches": {
      "get": {
        "description": "The parties the company waits for on the Peppol network, found or not.",
        "operationId": "listThePartiesWaitedFor",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "watches": {
                      "items": {
                        "$ref": "#/components/schemas/Watch"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List the parties waited for",
        "tags": [
          "Peppol directory"
        ]
      },
      "post": {
        "description": "Puts a watch on a Peppol ID. The network is asked daily; when the party is registered, the webhooks get a `participant.registered` event and `email`, if given, a mail. A party registered already is answered with 409 `ALREADY_REGISTERED` and the participant: there is nothing to wait for. Watching an ID watched already answers with the watch there is.",
        "operationId": "waitForAPartyToJoinPeppol",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "watch": {
                      "$ref": "#/components/schemas/Watch"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Wait for a party to join Peppol",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/watches/{id}": {
      "delete": {
        "operationId": "stopWaitingForAParty",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Stop waiting for a party",
        "tags": [
          "Peppol directory"
        ]
      },
      "get": {
        "operationId": "getAWatch",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "watch": {
                      "$ref": "#/components/schemas/Watch"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a watch",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/watches/{id}/check": {
      "post": {
        "description": "Asks the Peppol directory now instead of waiting for the daily sweep, and tells the company the same way if the party has appeared.",
        "operationId": "askTheNetworkAboutAWatchedPartyNow",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "watch": {
                      "$ref": "#/components/schemas/Watch"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Ask the network about a watched party now",
        "tags": [
          "Peppol directory"
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "events": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "webhooks": {
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List webhooks",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "operationId": "createAWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Create a webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "deleteAWebhook",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Delete a webhook",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "operationId": "getAWebhook",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Get a webhook",
        "tags": [
          "Webhooks"
        ]
      },
      "put": {
        "operationId": "replaceAWebhook",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Replace a webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listAWebhookSLatestDeliveries",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deliveries": {
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "List a webhook's latest deliveries",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "description": "Delivers a `webhook.test` event now and answers with how it went.",
        "operationId": "deliverATestEvent",
        "parameters": [
          {
            "description": "The id of what the path names: a document, a webhook, a watch, a company or an API key.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "delivery": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request was refused, or failed. `code` says why."
          }
        },
        "summary": "Deliver a test event",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "url": "/"
    }
  ],
  "tags": [
    {
      "description": "Invoices and credit notes: drafts, what has been sent, and what has been received.",
      "name": "Documents"
    },
    {
      "description": "What the Peppol rules say about a document, without storing or sending it.",
      "name": "Validation"
    },
    {
      "description": "Who is on the Peppol network, and what they receive.",
      "name": "Peppol directory"
    },
    {
      "description": "Where the company is told of what happens to its documents.",
      "name": "Webhooks"
    },
    {
      "description": "The companies of the person signed in, their settings, API keys and usage.",
      "name": "Companies"
    },
    {
      "description": "For those who run several companies, such as resellers: keys that reach every company of the account, and usage across them.",
      "name": "Account"
    },
    {
      "description": "For anyone, without a key: checks and conversions that store nothing. Limited per address.",
      "name": "Free tools"
    },
    {
      "description": "The code lists documents are validated against.",
      "name": "Reference data"
    }
  ],
  "webhooks": {
    "documentEvent": {
      "post": {
        "description": "Sent to every enabled webhook of the company that asks for the event. `data` is a WebhookDocument for the `document.*` events, a WebhookRegistered for `participant.registered`, and nothing for `webhook.test`.",
        "operationId": "documentEvent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx status says the event was received."
          }
        },
        "summary": "Something happened to a document, or to a watched party"
      }
    }
  }
}