{
  "openapi": "3.0.0",
  "info": {
    "title": "InformerOnline API",
    "description": "Move your app forward with the InformerOnline API\nFirst make sure you have a valid Informer account, then click <a href='https://app.informer.eu/settings/api/' target='_blank'>here</a> to create your API key.\n\nALL DATES ARE IN FORMAT 'YYYY-mm-dd'!\n\nIf anything in this documentation is not clear enough or you require assistance related to the API, you can contact support at api@informer.eu\n",
    "contact": {
      "email": "api@informer.eu"
    },
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.informer.eu/v2",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "Code": [],
      "Apikey": []
    }
  ],
  "tags": [
    {
      "name": "Administration",
      "description": "Details about the administration this API-key is linked to"
    },
    {
      "name": "Relations",
      "description": "Manage relations (customers, suppliers, leads, prospects)"
    },
    {
      "name": "Contacts",
      "description": "Manage contact persons linked to relations"
    },
    {
      "name": "Sales Invoices",
      "description": "Create, retrieve, update and send sales invoices"
    },
    {
      "name": "Purchase Invoices",
      "description": "Create and retrieve purchase invoices"
    },
    {
      "name": "Recurring Invoices",
      "description": "Create, retrieve and update recurring invoices"
    },
    {
      "name": "Sales Orders",
      "description": "Create, retrieve, update and send sales orders (requires trade module)"
    },
    {
      "name": "Quotations",
      "description": "Create, retrieve, update and send quotations"
    },
    {
      "name": "Salesbook",
      "description": "Create, retrieve and update salesbook invoices (purchase invoices logged in the sales book)"
    },
    {
      "name": "Payment Conditions",
      "description": "Retrieve payment conditions configured for the administration"
    },
    {
      "name": "Templates",
      "description": "Retrieve document templates for invoices, orders and quotations"
    },
    {
      "name": "VAT",
      "description": "Retrieve VAT/tax options and percentages"
    },
    {
      "name": "Ledgers",
      "description": "Retrieve ledger (chart of accounts) options"
    },
    {
      "name": "Costs",
      "description": "Retrieve cost centre accounts"
    },
    {
      "name": "Currencies",
      "description": "Retrieve available currencies and exchange rates"
    },
    {
      "name": "Attachments",
      "description": "Retrieve available document attachments"
    },
    {
      "name": "Products",
      "description": "Retrieve products (requires trade module)"
    },
    {
      "name": "Memorandum",
      "description": "Create, retrieve, update and delete memorandum journal entries"
    },
    {
      "name": "Reports",
      "description": "Retrieve financial reports such as the balance sheet and column balance"
    }
  ],
  "paths": {
    "/administration": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get administration details",
        "description": "Get details about the administration linked to this API key, including address, contact information, tax IDs and active modules.",
        "responses": {
          "200": {
            "description": "Administration details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/relations/{id}": {
      "get": {
        "tags": [
          "Relations"
        ],
        "summary": "Get a single relation",
        "description": "Get a single relation by ID. Includes contacts, tags and custom fields (free fields).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the relation.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Relation details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RelationDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Relations"
        ],
        "summary": "Update a relation",
        "description": "Update an existing relation by ID. Not all fields are required; you can send only the fields you want to update.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the relation to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Relation updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string",
                      "example": "Relation saved"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Relation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/relations": {
      "get": {
        "tags": [
          "Relations"
        ],
        "summary": "Get a list of relations",
        "description": "Get a paginated list of all relations. For each relation the contacts, tags and subtypes are included.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page (default = 20).",
            "schema": {
              "type": "integer",
              "default": 20
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search string. Searches in company name, street, city and relation number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return relations edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of relations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "relations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Relation"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Relations"
        ],
        "summary": "Create a new relation",
        "description": "Create a new relation. The relation_number is optional; if omitted or 0, a new number is generated. The fields sales_invoice_template_id and payment_condition_id are optional; default values will be used if not provided.\n\nWhen relation_type is 0 (company): company_name is required, firstname/surname are forbidden.\nWhen relation_type is 1 (private): firstname and surname are required, company_name is forbidden.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Relation created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string",
                      "example": "Relation saved"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Relation not found (when updating)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/contact/{id}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get a single contact",
        "description": "Get a single contact person by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the contact.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Update an existing contact person by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the contact to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string",
                      "example": "Contact saved"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Contact not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/contact": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create a new contact",
        "description": "Create a new contact person linked to a relation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string",
                      "example": "Contact saved"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/{id}": {
      "get": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Get a single sales invoice",
        "description": "Get a single sales invoice by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sales invoice details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Update a sales invoice",
        "description": "Update an existing sales invoice by ID. The invoice must be in concept status.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales": {
      "get": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Get a list of sales invoices",
        "description": "Get a paginated list of all sales invoices with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter invoices by status.",
            "schema": {
              "type": "string",
              "enum": [
                "concept",
                "open",
                "collect",
                "accruals",
                "collection_fines",
                "payment_plans"
              ]
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return invoices edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return invoices for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. date.desc). Available fields: created, name, number, date, amount, invoiceAmountPaid, invoiceAmountOpen.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of sales invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "invoices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SalesInvoice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Create a new sales invoice",
        "description": "Create a new sales invoice. Use the /invoices/sales/options endpoint first to determine valid combinations of vat_id, ledger_id and vat_option.\n\nLines can be either regular lines (with qty, amount, vat_id, ledger_id) or info lines (with info=true and description only).\n\nFor administrations in Austria (AT) or Germany (DE), the delivery_date field is also required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found (e.g. relation_id does not exist)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/options": {
      "get": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Get sales invoice options",
        "description": "Get the available VAT rates with their compatible ledger accounts and VAT options. Use this endpoint to determine valid combinations of vat_id, ledger_id and vat_option when creating invoices.",
        "responses": {
          "200": {
            "description": "Array of VAT rates with their compatible ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VatLedgerOption"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/pdf/{id}": {
      "get": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Get sales invoice PDF",
        "description": "Download the PDF of a sales invoice as a base64-encoded string.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64-encoded PDF file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF content."
                    },
                    "filename": {
                      "type": "string",
                      "description": "The filename of the PDF."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No PDF available for this sales invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/send/{id}": {
      "post": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Send a sales invoice",
        "description": "Send a sales invoice via email, mark as sent, or send via Peppol. The invoice will be finalized before sending.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice to send.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Invoice has been sent successfully"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or send failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/{id}/attachments": {
      "post": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Upload an invoice-specific attachment",
        "description": "Upload a file as a document-specific attachment for a sales invoice. The file content must be base64-encoded. Supported types: PDF, PNG, JPEG, GIF, DOC, DOCX, XLS, XLSX. Maximum size: 10 MB. The attachment is automatically included when the invoice is sent by email and is preserved when the invoice is updated. Do not reference these IDs in the 'attachments' field of POST/PUT requests; manage them only through this endpoint.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "file"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "description": "Original filename including extension (e.g. 'contract.pdf').",
                    "example": "contract.pdf"
                  },
                  "file": {
                    "type": "string",
                    "description": "Base64-encoded file content."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attachment uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "ID of the created attachment."
                    },
                    "filename": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "description": "File size in bytes."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (missing fields, invalid base64, unsupported type, or file too large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/sales/{id}/attachments/{attachment_id}": {
      "get": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Download an invoice attachment",
        "description": "Download the file content of an attachment linked to a sales invoice, base64-encoded. Works for both shared library attachments and invoice-specific document attachments, as long as the attachment is linked to this invoice. The file content is only returned by this endpoint, not in the invoice GET response.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The ID of the attachment to download.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment file content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "ID of the attachment."
                    },
                    "filename": {
                      "type": "string",
                      "nullable": true,
                      "description": "Original filename."
                    },
                    "file": {
                      "type": "string",
                      "description": "Base64-encoded file content."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "attachment_id is not numeric",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invoice or attachment not found, or file missing from storage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Sales Invoices"
        ],
        "summary": "Delete an invoice-specific attachment",
        "description": "Delete a document-specific attachment from a sales invoice. The file is permanently removed from storage.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales invoice.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "description": "The ID of the attachment to delete.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "ID of the deleted attachment."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "attachment_id is not numeric",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invoice or attachment not found for this invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/purchase/{id}": {
      "get": {
        "tags": [
          "Purchase Invoices"
        ],
        "summary": "Get a single purchase invoice",
        "description": "Get a single purchase invoice by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the purchase invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Purchase invoice details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/purchase": {
      "get": {
        "tags": [
          "Purchase Invoices"
        ],
        "summary": "Get a list of purchase invoices",
        "description": "Get a paginated list of all purchase invoices with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter purchase invoices by status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "expired",
                "process",
                "approve",
                "accruals"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. date.desc). Available fields: created, name, number, date, expiry_date, amount, invoiceAmountPaid, invoiceAmountOpen.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return invoices edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return invoices for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of purchase invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "invoices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PurchaseInvoice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Purchase Invoices"
        ],
        "summary": "Create a new purchase invoice",
        "description": "Create a new purchase invoice. Use the /invoices/purchase/options endpoint first to determine valid combinations of vat_id and ledger_id.\n\nThe amount field per line is the gross amount (excl or incl VAT depending on vat_option). The vat_amount is the VAT portion of that amount.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Purchase invoice created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the created purchase invoice."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/purchase/options": {
      "get": {
        "tags": [
          "Purchase Invoices"
        ],
        "summary": "Get purchase invoice options",
        "description": "Get the available VAT rates with their compatible ledger accounts for creating purchase invoices.",
        "responses": {
          "200": {
            "description": "VAT and ledger options for purchase invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ledgers": {
                      "type": "array",
                      "description": "Available ledger accounts.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "number": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "vat": {
                      "type": "array",
                      "description": "Available VAT rates.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "percentage": {
                            "type": "number",
                            "format": "float"
                          }
                        }
                      }
                    },
                    "vat_options": {
                      "type": "object",
                      "description": "Available VAT options.",
                      "properties": {
                        "excl": {
                          "type": "boolean"
                        },
                        "incl": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/invoices/purchase/pdf/{id}": {
      "get": {
        "tags": [
          "Purchase Invoices"
        ],
        "summary": "Get purchase invoice PDF",
        "description": "Download the PDF attached to a purchase invoice as a base64-encoded string.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the purchase invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64-encoded PDF file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF content."
                    },
                    "filename": {
                      "type": "string",
                      "description": "The filename of the PDF."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No PDF available for this purchase invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/recurring/{id}": {
      "get": {
        "tags": [
          "Recurring Invoices"
        ],
        "summary": "Get a single recurring invoice",
        "description": "Get a single recurring invoice by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the recurring invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Recurring Invoices"
        ],
        "summary": "Update a recurring invoice",
        "description": "Update an existing recurring invoice by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the recurring invoice to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recurring invoice updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Recurring invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/recurring": {
      "get": {
        "tags": [
          "Recurring Invoices"
        ],
        "summary": "Get a list of recurring invoices",
        "description": "Get a paginated list of all recurring invoices with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter recurring invoices by status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "ended"
              ]
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return recurring invoices edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return recurring invoices for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. start_date.desc). Available fields: created, name, contact, number, type, period, start_date, end_date, invoice_date, amount.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of recurring invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "recurring_invoices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RecurringInvoice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Recurring Invoices"
        ],
        "summary": "Create a new recurring invoice",
        "description": "Create a new recurring invoice. Use the /invoices/recurring/options endpoint first to determine valid combinations of vat_id, ledger_id and vat_option.\n\nLines can be either regular lines (with qty, amount, vat_id, ledger_id) or info lines (with info=true and description only).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringInvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recurring invoice created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found (e.g. relation_id does not exist)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/recurring/options": {
      "get": {
        "tags": [
          "Recurring Invoices"
        ],
        "summary": "Get recurring invoice options",
        "description": "Get the available VAT rates with their compatible ledger accounts and VAT options. Use this endpoint to determine valid combinations of vat_id, ledger_id and vat_option when creating recurring invoices. Per VAT rate the usable ledger accounts and compatible vat_option values are returned.",
        "responses": {
          "200": {
            "description": "Array of VAT rates with their compatible ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VatLedgerOption"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/orders/sales/{id}": {
      "get": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Get a single sales order",
        "description": "Get a single sales order by ID, including all line items. Requires the trade module to be active.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales order.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sales order details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrder"
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Update a sales order",
        "description": "Update an existing sales order by ID. Requires the trade module to be active.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales order to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/orders/sales": {
      "get": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Get a list of sales orders",
        "description": "Get a paginated list of all sales orders with their line items. Requires the trade module to be active.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter orders by status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "compleet",
                "invoice",
                "cancelled"
              ]
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return orders edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return orders for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. date.desc). Available fields: created, number, name, date, amount.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of sales orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "orders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SalesOrder"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Create a new sales order",
        "description": "Create a new sales order. Requires the trade module to be active. Use the /orders/sales/options endpoint first to determine valid combinations of vat_id, ledger_id and vat_option.\n\nFor administrations in Austria (AT) or Germany (DE), the delivery_date field is also required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/orders/sales/options": {
      "get": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Get sales order options",
        "description": "Get the available VAT rates with their compatible ledger accounts and VAT options for creating sales orders. Requires the trade module to be active.",
        "responses": {
          "200": {
            "description": "Array of VAT rates with their compatible ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VatLedgerOption"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active for this administration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/sales/pdf/{id}": {
      "get": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Get sales order PDF",
        "description": "Download the PDF of a sales order as a base64-encoded string.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales order.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64-encoded PDF file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF content."
                    },
                    "filename": {
                      "type": "string",
                      "description": "The filename of the PDF."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No PDF available for this sales order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/sales/send/{id}": {
      "post": {
        "tags": [
          "Sales Orders"
        ],
        "summary": "Send a sales order",
        "description": "Send a sales order via email or mark as sent. Requires the trade module to be active. Peppol is not available for sales orders.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the sales order to send.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Order has been sent successfully"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Trade module is not active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or send failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quotations/{id}": {
      "get": {
        "tags": [
          "Quotations"
        ],
        "summary": "Get a single quotation",
        "description": "Get a single quotation by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the quotation.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quotation details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quotation"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Quotations"
        ],
        "summary": "Update a quotation",
        "description": "Update an existing quotation by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the quotation to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quotation updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Quotation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/quotations": {
      "get": {
        "tags": [
          "Quotations"
        ],
        "summary": "Get a list of quotations",
        "description": "Get a paginated list of all quotations with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter quotations by status.",
            "schema": {
              "type": "string",
              "enum": [
                "concept",
                "open",
                "expired",
                "accepted",
                "cancelled"
              ]
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return quotations edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return quotations for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. date.desc). Available fields: created, number, name, date, expirationDate, succesRate, amount.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of quotations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "invoices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Quotation"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Quotations"
        ],
        "summary": "Create a new quotation",
        "description": "Create a new quotation. Use the /quotations/options endpoint first to determine valid combinations of vat_id, ledger_id and vat_option.\n\nFor administrations in Austria (AT) or Germany (DE), the delivery_date field is also required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quotation created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/quotations/options": {
      "get": {
        "tags": [
          "Quotations"
        ],
        "summary": "Get quotation options",
        "description": "Get the available VAT rates with their compatible ledger accounts and VAT options for creating quotations.",
        "responses": {
          "200": {
            "description": "Array of VAT rates with their compatible ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VatLedgerOption"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/quotations/pdf/{id}": {
      "get": {
        "tags": [
          "Quotations"
        ],
        "summary": "Get quotation PDF",
        "description": "Download the PDF of a quotation as a base64-encoded string.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the quotation.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64-encoded PDF file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF content."
                    },
                    "filename": {
                      "type": "string",
                      "description": "The filename of the PDF."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No PDF available for this quotation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quotations/send/{id}": {
      "post": {
        "tags": [
          "Quotations"
        ],
        "summary": "Send a quotation",
        "description": "Send a quotation via email, mark as sent, or send via Peppol.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the quotation to send.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quotation sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Quotation has been sent successfully"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Quotation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or send failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/salesbook/{id}": {
      "get": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Get a single salesbook invoice",
        "description": "Get a single salesbook invoice by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the salesbook invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Salesbook invoice details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SalesbookInvoice"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Update a salesbook invoice",
        "description": "Update an existing salesbook invoice by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the salesbook invoice to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesbookInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Salesbook invoice updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Salesbook invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/salesbook": {
      "get": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Get a list of salesbook invoices",
        "description": "Get a paginated list of all salesbook invoices with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter salesbook invoices by status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "collect",
                "accruals",
                "process"
              ]
            }
          },
          {
            "name": "last_edit",
            "in": "query",
            "required": false,
            "description": "Only return salesbook invoices edited after this date (format: YYYY-mm-dd).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "relation_id",
            "in": "query",
            "required": false,
            "description": "Only return salesbook invoices for the relation with this ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Format: field.direction (e.g. date.desc). Available fields: created, name, number, date, amount, invoiceAmountPaid, invoiceAmountOpen.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of salesbook invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "invoices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SalesbookInvoice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Create a new salesbook invoice",
        "description": "Create a new salesbook invoice. Use the /salesbook/options endpoint first to determine valid combinations of vat_id, ledger_id and vat_option.\n\nA PDF file can optionally be attached as a base64-encoded string.\n\nFor administrations in Austria (AT) or Germany (DE), the delivery_date field is also required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesbookInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Salesbook invoice created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/salesbook/options": {
      "get": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Get salesbook options",
        "description": "Get the available VAT rates with their compatible ledger accounts and VAT options for creating salesbook invoices.",
        "responses": {
          "200": {
            "description": "Array of VAT rates with their compatible ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VatLedgerOption"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/salesbook/pdf/{id}": {
      "get": {
        "tags": [
          "Salesbook"
        ],
        "summary": "Get salesbook PDF",
        "description": "Download the PDF file attached to a salesbook invoice as a base64-encoded string.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the salesbook invoice.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64-encoded PDF file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF content."
                    },
                    "filename": {
                      "type": "string",
                      "description": "The filename of the PDF."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No file attached to this salesbook invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payment-conditions": {
      "get": {
        "tags": [
          "Payment Conditions"
        ],
        "summary": "Get all payment conditions",
        "description": "Get a list of all payment conditions configured for this administration.",
        "responses": {
          "200": {
            "description": "Array of payment conditions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentCondition"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Get all templates",
        "description": "Get a list of all document templates configured for this administration.",
        "responses": {
          "200": {
            "description": "Array of templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Template"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vat": {
      "get": {
        "tags": [
          "VAT"
        ],
        "summary": "Get all VAT options",
        "description": "Get a list of all VAT/tax rates configured for this administration, including their percentages, codes and availability status.",
        "responses": {
          "200": {
            "description": "Array of VAT options",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vat"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledgers": {
      "get": {
        "tags": [
          "Ledgers"
        ],
        "summary": "Get all ledger accounts",
        "description": "Get a list of all ledger accounts (chart of accounts) for this administration, including VAT codes, cost centre settings, RGS codes and condensation codes.",
        "responses": {
          "200": {
            "description": "Array of ledger accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Ledger"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/costs": {
      "get": {
        "tags": [
          "Costs"
        ],
        "summary": "Get all cost centre accounts",
        "description": "Get a list of all cost centre accounts for this administration.",
        "responses": {
          "200": {
            "description": "Array of cost centre accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CostCentre"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/currencies": {
      "get": {
        "tags": [
          "Currencies"
        ],
        "summary": "Get all currencies",
        "description": "Get a list of all currencies configured for this administration, including exchange rates.",
        "responses": {
          "200": {
            "description": "Array of currencies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Currency"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/journals": {
      "get": {
        "tags": [
          "Journals"
        ],
        "summary": "Get all journals",
        "description": "Get a list of all journals (dagboeken) for this administration.",
        "responses": {
          "200": {
            "description": "Array of journals",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Journal"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscription-types": {
      "get": {
        "tags": [
          "Subscription types"
        ],
        "summary": "Get all subscription types",
        "description": "Get a list of all subscription types (abonnementstypes) for this administration.",
        "responses": {
          "200": {
            "description": "Array of subscription types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SubscriptionType"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/attachments": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Get all attachments",
        "description": "Get a list of all available document attachments for this administration.",
        "responses": {
          "200": {
            "description": "Array of attachments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Attachment"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get all products",
        "description": "Get a list of all products for this administration, including supplier information. Requires the trade module to be active.",
        "responses": {
          "200": {
            "description": "Array of products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/receipts/{id}": {
      "get": {
        "tags": [
          "Receipts"
        ],
        "summary": "Get a single receipt",
        "description": "Get a single receipt by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the receipt.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "404": {
            "description": "Receipt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Receipts"
        ],
        "summary": "Update a receipt",
        "description": "Update an existing receipt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the receipt to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Receipt updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the updated receipt."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Receipt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/receipts": {
      "get": {
        "tags": [
          "Receipts"
        ],
        "summary": "Get a list of receipts",
        "description": "Get a paginated list of all receipts (bonnetjes) for this administration.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Filter results by processing status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "processed"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order in `field.direction` format. Supported fields: `date`, `type`, `description`, `amount`. Default: `date.desc`.",
            "schema": {
              "type": "string",
              "example": "date.desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of receipts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "receipts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Receipt"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Receipts"
        ],
        "summary": "Create a new receipt",
        "description": "Create a new receipt.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Receipt created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the created receipt."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/memorandum/{id}": {
      "get": {
        "tags": [
          "Memorandum"
        ],
        "summary": "Get a single memorandum entry",
        "description": "Get a single memorandum journal entry by ID, including all line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the memorandum entry.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Memorandum entry details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memorandum"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Memorandum"
        ],
        "summary": "Update a memorandum entry",
        "description": "Update an existing memorandum journal entry. All lines are replaced with the newly provided lines. Debit and credit totals across all lines must be equal.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the memorandum entry to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemorandumInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Memorandum entry updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the updated memorandum entry."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/memorandum": {
      "get": {
        "tags": [
          "Memorandum"
        ],
        "summary": "Get a list of memorandum entries",
        "description": "Get a paginated list of all memorandum journal entries with their line items.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default = 1).",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "records",
            "in": "query",
            "required": false,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of memorandum entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "memorandums": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Memorandum"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Memorandum"
        ],
        "summary": "Create a new memorandum entry",
        "description": "Create a new memorandum journal entry. Debit and credit totals across all lines must be equal.\n\nOptionally link a line to an existing sales invoice, purchase invoice or receipt by providing both `type` and `invoice_id` on the line.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemorandumInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Memorandum entry created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the created memorandum entry."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/reports/balance": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get balance sheet",
        "description": "Get a balance sheet report for a given year range and period.",
        "parameters": [
          {
            "name": "year_from",
            "in": "query",
            "required": true,
            "description": "Start year of the report (e.g. 2024).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "year_to",
            "in": "query",
            "required": true,
            "description": "End year of the report (e.g. 2024).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": true,
            "description": "Accounting period number (1–13).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Balance sheet report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance": {
                      "$ref": "#/components/schemas/BalanceReport"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Missing required parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reports/column-balance": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get column balance",
        "description": "Get a column balance (proef- en saldibalans) for a given year, period range and ledger account range.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "description": "Fiscal year (e.g. 2024).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": true,
            "description": "Start period number (1–13).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": true,
            "description": "End period number (1–13).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ledger_number_from",
            "in": "query",
            "required": true,
            "description": "Start of the ledger account number range.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ledger_number_to",
            "in": "query",
            "required": true,
            "description": "End of the ledger account number range.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Column balance report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "column_balance": {
                      "$ref": "#/components/schemas/ColumnBalanceReport"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Missing required parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Administration": {
        "type": "object",
        "properties": {
          "company_name": {
            "type": "string",
            "description": "The name of the administration."
          },
          "contact": {
            "type": "string",
            "description": "Contact person name."
          },
          "address": {
            "type": "string",
            "description": "Street name."
          },
          "house_number": {
            "type": "string",
            "description": "House number."
          },
          "house_number_suffix": {
            "type": "string",
            "description": "Suffix for the house number."
          },
          "zip": {
            "type": "string",
            "description": "The address zip code."
          },
          "city": {
            "type": "string",
            "description": "The city."
          },
          "country": {
            "type": "string",
            "description": "The country ISO code."
          },
          "email": {
            "type": "string",
            "description": "E-mail address."
          },
          "phone_number": {
            "type": "string",
            "description": "Phone number."
          },
          "mobile": {
            "type": "string",
            "description": "Mobile phone number."
          },
          "web": {
            "type": "string",
            "description": "Website URL."
          },
          "coc": {
            "type": "string",
            "description": "Chamber of Commerce number."
          },
          "vat": {
            "type": "string",
            "description": "VAT number."
          },
          "oin": {
            "type": "string",
            "description": "OIN number."
          },
          "iban": {
            "type": "string",
            "description": "IBAN number."
          },
          "bic": {
            "type": "string",
            "description": "BIC code."
          },
          "modules": {
            "type": "object",
            "properties": {
              "trade": {
                "type": "boolean",
                "description": "Whether the trade module is active."
              }
            }
          }
        },
        "example": {
          "company_name": "Bakkerij De Gouden Bol BV",
          "contact": "Jan de Vries",
          "address": "Voorbeeldstraat",
          "house_number": "12",
          "house_number_suffix": "A",
          "zip": "1234 AB",
          "city": "Amsterdam",
          "country": "NL",
          "email": "info@voorbeeld.nl",
          "phone_number": "020-1234567",
          "mobile": null,
          "web": "https://www.voorbeeld.nl",
          "coc": "12345678",
          "vat": "NL123456789B01",
          "oin": null,
          "iban": "NL00EXAM0000000000",
          "bic": "EXAMNL2A",
          "modules": {
            "trade": false
          },
          "blocked_period": {
            "year": 2025,
            "month": 12
          }
        }
      },
      "Relation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_number": {
            "type": "integer",
            "description": "The unique relation number within the administration."
          },
          "relation_type": {
            "type": "integer",
            "description": "0 = company, 1 = private person.",
            "enum": [
              0,
              1
            ]
          },
          "company_name": {
            "type": "string",
            "description": "Company name (when relation_type = 0).",
            "nullable": true
          },
          "firstname": {
            "type": "string",
            "description": "First name (when relation_type = 1).",
            "nullable": true
          },
          "surname_prefix": {
            "type": "string",
            "description": "Surname prefix (e.g. 'van', 'de').",
            "nullable": true
          },
          "surname": {
            "type": "string",
            "description": "Surname (when relation_type = 1).",
            "nullable": true
          },
          "street": {
            "type": "string",
            "description": "Street name."
          },
          "house_number": {
            "type": "string",
            "description": "House number."
          },
          "house_number_suffix": {
            "type": "string",
            "description": "House number suffix.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "country": {
            "type": "string",
            "description": "Country ISO code (e.g. NL, DE, BE)."
          },
          "phone": {
            "type": "string",
            "description": "Phone number.",
            "nullable": true
          },
          "fax": {
            "type": "string",
            "description": "Fax number.",
            "nullable": true
          },
          "web": {
            "type": "string",
            "description": "Website URL.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "E-mail address.",
            "nullable": true
          },
          "coc": {
            "type": "string",
            "description": "Chamber of Commerce number.",
            "nullable": true
          },
          "vat": {
            "type": "string",
            "description": "VAT number.",
            "nullable": true
          },
          "oin": {
            "type": "string",
            "description": "OIN number.",
            "nullable": true
          },
          "iban": {
            "type": "string",
            "description": "IBAN number.",
            "nullable": true
          },
          "bic": {
            "type": "string",
            "description": "BIC code.",
            "nullable": true
          },
          "email_invoice": {
            "type": "string",
            "description": "E-mail address for invoices.",
            "nullable": true
          },
          "sales_invoice_template_id": {
            "type": "integer",
            "description": "Default sales invoice template ID.",
            "nullable": true
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Default payment condition ID.",
            "nullable": true
          },
          "collection_number": {
            "type": "string",
            "description": "Collection mandate number.",
            "nullable": true
          },
          "collection_date": {
            "type": "string",
            "description": "Collection mandate date (YYYY-mm-dd).",
            "format": "date",
            "nullable": true
          },
          "direct_debit_authorisation": {
            "type": "boolean",
            "description": "Whether a direct debit authorisation is active for this relation."
          },
          "preferred_send_method": {
            "type": "string",
            "description": "Preferred send method for this relation.",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of last edit.",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this relation in the Informer web app."
          },
          "subtype": {
            "$ref": "#/components/schemas/RelationSubtype"
          },
          "contacts": {
            "type": "array",
            "description": "Contact persons.",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "tags": {
            "type": "array",
            "description": "Tags assigned to this relation.",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "id": 1001,
          "relation_number": 1001,
          "relation_type": 0,
          "company_name": "Bakkerij De Gouden Bol BV",
          "firstname": null,
          "surname_prefix": null,
          "surname": null,
          "street": "Voorbeeldstraat",
          "house_number": "12",
          "house_number_suffix": "A",
          "city": "Amsterdam",
          "country": "NL",
          "phone": "020-1234567",
          "fax": null,
          "web": "https://www.voorbeeld.nl",
          "email": "inkoop@voorbeeld.nl",
          "coc": "12345678",
          "vat": "NL123456789B01",
          "oin": null,
          "iban": "NL00EXAM0000000000",
          "bic": "EXAMNL2A",
          "email_invoice": "facturen@voorbeeld.nl",
          "sales_invoice_template_id": 1,
          "payment_condition_id": 1,
          "collection_number": null,
          "collection_date": null,
          "direct_debit_authorisation": false,
          "preferred_send_method": "email",
          "last_edit": "2024-01-15 09:30:00",
          "url": "https://app.informer.eu/relation/1001",
          "subtype": {
            "lead": false,
            "supplier": false,
            "prospect": false,
            "active": true,
            "customer": true
          },
          "contacts": [
            {
              "initials": "J.",
              "firstname": "Jan",
              "surname_prefix": "de",
              "surname": "Vries",
              "gender": "m",
              "function": "Directeur",
              "department": null,
              "phone": "020-1234567",
              "mobile": "06-12345678",
              "email": "jan@voorbeeld.nl"
            }
          ],
          "tags": []
        }
      },
      "RelationDetail": {
        "description": "Same as Relation but also includes freefields (custom fields).",
        "allOf": [
          {
            "$ref": "#/components/schemas/Relation"
          },
          {
            "type": "object",
            "properties": {
              "freefields": {
                "type": "array",
                "description": "Custom fields configured for relations.",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "description": "Field label."
                    },
                    "type": {
                      "type": "string",
                      "description": "Field type.",
                      "enum": [
                        "text",
                        "textarea",
                        "date",
                        "radio",
                        "selectbox",
                        "checkbox"
                      ]
                    },
                    "value": {
                      "description": "Field value (string for most types, null if not set)."
                    },
                    "options": {
                      "type": "array",
                      "description": "For checkbox fields, an array of option objects.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "value": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "example": {
          "id": 1001,
          "relation_number": 1001,
          "relation_type": 0,
          "company_name": "Bakkerij De Gouden Bol BV",
          "firstname": null,
          "surname_prefix": null,
          "surname": null,
          "street": "Voorbeeldstraat",
          "house_number": "12",
          "city": "Amsterdam",
          "country": "NL",
          "email": "inkoop@voorbeeld.nl",
          "last_edit": "2024-01-15 09:30:00",
          "url": "https://app.informer.eu/relation/1001",
          "subtype": {
            "lead": false,
            "supplier": false,
            "prospect": false,
            "active": true,
            "customer": true
          },
          "contacts": [],
          "tags": [],
          "freefields": [
            {
              "description": "Klantnummer extern",
              "type": "text",
              "value": "EXT-9876"
            }
          ]
        }
      },
      "RelationSubtype": {
        "type": "object",
        "properties": {
          "lead": {
            "type": "boolean",
            "description": "Whether this relation is marked as a lead."
          },
          "supplier": {
            "type": "boolean",
            "description": "Whether this relation is marked as a supplier."
          },
          "prospect": {
            "type": "boolean",
            "description": "Whether this relation is marked as a prospect."
          },
          "active": {
            "type": "boolean",
            "description": "Whether this relation is marked as active."
          },
          "customer": {
            "type": "boolean",
            "description": "Whether this relation is marked as a customer."
          }
        },
        "example": {
          "lead": false,
          "supplier": false,
          "prospect": false,
          "active": true,
          "customer": true
        }
      },
      "RelationInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RelationInputCompany"
          },
          {
            "$ref": "#/components/schemas/RelationInputPrivate"
          }
        ],
        "description": "Use RelationInputCompany (relation_type=0) for companies, RelationInputPrivate (relation_type=1) for private persons."
      },
      "RelationInputBase": {
        "type": "object",
        "required": [
          "relation_type",
          "street",
          "house_number",
          "zip",
          "city",
          "country"
        ],
        "properties": {
          "relation_number": {
            "type": "integer",
            "description": "Optional. If 0 or not provided, a new number is generated. Must be unique within the administration."
          },
          "relation_type": {
            "type": "integer",
            "description": "0 = company, 1 = private person.",
            "enum": [
              0,
              1
            ]
          },
          "street": {
            "type": "string",
            "description": "Street name."
          },
          "house_number": {
            "type": "string",
            "description": "House number."
          },
          "house_number_suffix": {
            "type": "string",
            "description": "Optional house number suffix."
          },
          "zip": {
            "type": "string",
            "description": "Zip/postal code."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "country": {
            "type": "string",
            "description": "Country ISO code (e.g. NL, DE, BE)."
          },
          "phone": {
            "type": "string",
            "description": "Phone number."
          },
          "fax": {
            "type": "string",
            "description": "Fax number."
          },
          "web": {
            "type": "string",
            "description": "Website URL. Must be a valid URL.",
            "format": "uri"
          },
          "email": {
            "type": "string",
            "description": "E-mail address. Must be a valid email.",
            "format": "email"
          },
          "coc": {
            "type": "string",
            "description": "Chamber of Commerce number."
          },
          "vat": {
            "type": "string",
            "description": "VAT number. Will be validated."
          },
          "iban": {
            "type": "string",
            "description": "IBAN number. Will be validated."
          },
          "bic": {
            "type": "string",
            "description": "BIC code."
          },
          "oin": {
            "type": "string",
            "description": "OIN number."
          },
          "collection_number": {
            "type": "string",
            "description": "Collection mandate number."
          },
          "collection_date": {
            "type": "string",
            "description": "Collection mandate date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "email_invoice": {
            "type": "string",
            "description": "E-mail address for invoices. Must be a valid email.",
            "format": "email"
          },
          "sales_invoice_template_id": {
            "type": "integer",
            "description": "Default sales invoice template ID. If not provided, the administration default is used."
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Default payment condition ID. If not provided, the administration default is used."
          },
          "subtype": {
            "type": "object",
            "description": "Relation subtypes. Each value should be 0 or 1.",
            "properties": {
              "lead": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "supplier": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "prospect": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "active": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "customer": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            }
          },
          "customfields": {
            "type": "object",
            "description": "Custom fields. Keys are the field descriptions, values depend on the field type. Use GET /relations/{id} to see available custom fields and their types.",
            "additionalProperties": true
          }
        }
      },
      "RelationInputCompany": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RelationInputBase"
          },
          {
            "type": "object",
            "required": [
              "company_name"
            ],
            "properties": {
              "relation_type": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "company_name": {
                "type": "string",
                "description": "Company name (required for companies)."
              }
            }
          }
        ],
        "example": {
          "relation_number": 0,
          "relation_type": 0,
          "company_name": "Bakkerij De Gouden Bol BV",
          "street": "Voorbeeldstraat",
          "house_number": "12",
          "house_number_suffix": "A",
          "zip": "1234 AB",
          "city": "Amsterdam",
          "country": "NL",
          "email": "inkoop@voorbeeld.nl",
          "phone": "020-1234567",
          "vat": "NL123456789B01",
          "coc": "12345678",
          "iban": "NL00EXAM0000000000",
          "payment_condition_id": 1,
          "subtype": {
            "customer": 1
          }
        }
      },
      "RelationInputPrivate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RelationInputBase"
          },
          {
            "type": "object",
            "required": [
              "firstname",
              "surname"
            ],
            "properties": {
              "relation_type": {
                "type": "integer",
                "enum": [
                  1
                ]
              },
              "firstname": {
                "type": "string",
                "description": "First name (required for private persons)."
              },
              "surname_prefix": {
                "type": "string",
                "description": "Optional surname prefix (e.g. 'van', 'de')."
              },
              "surname": {
                "type": "string",
                "description": "Surname (required for private persons)."
              }
            }
          }
        ],
        "example": {
          "relation_number": 0,
          "relation_type": 1,
          "firstname": "Jan",
          "surname_prefix": "van",
          "surname": "Bakker",
          "street": "Voorbeeldstraat",
          "house_number": "12",
          "zip": "1234 AB",
          "city": "Amsterdam",
          "country": "NL",
          "email": "jan@voorbeeld.nl",
          "payment_condition_id": 1,
          "subtype": {
            "customer": 1
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the contact."
          },
          "initials": {
            "type": "string",
            "description": "Initials.",
            "nullable": true
          },
          "firstname": {
            "type": "string",
            "description": "First name."
          },
          "surname_prefix": {
            "type": "string",
            "description": "Surname prefix.",
            "nullable": true
          },
          "surname": {
            "type": "string",
            "description": "Surname."
          },
          "gender": {
            "type": "string",
            "description": "Gender: m = male, f = female, o = other.",
            "enum": [
              "m",
              "f",
              "o"
            ]
          },
          "function": {
            "type": "string",
            "description": "Job function/title.",
            "nullable": true
          },
          "department": {
            "type": "string",
            "description": "Department.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number.",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "description": "Mobile phone number.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "E-mail address.",
            "nullable": true
          }
        },
        "example": {
          "id": 42,
          "initials": "J.",
          "firstname": "Jan",
          "surname_prefix": "de",
          "surname": "Vries",
          "gender": "m",
          "function": "Directeur",
          "department": null,
          "phone": "020-1234567",
          "mobile": "06-12345678",
          "email": "jan@voorbeeld.nl"
        }
      },
      "ContactInput": {
        "type": "object",
        "required": [
          "relation_id",
          "firstname",
          "surname",
          "gender"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "The ID of the relation this contact belongs to. Must be a valid relation in this administration."
          },
          "initials": {
            "type": "string",
            "description": "Initials."
          },
          "firstname": {
            "type": "string",
            "description": "First name."
          },
          "surname_prefix": {
            "type": "string",
            "description": "Surname prefix."
          },
          "surname": {
            "type": "string",
            "description": "Surname."
          },
          "gender": {
            "type": "string",
            "description": "Gender: m = male, f = female, o = other.",
            "enum": [
              "m",
              "f",
              "o"
            ]
          },
          "function": {
            "type": "string",
            "description": "Job function/title."
          },
          "department": {
            "type": "string",
            "description": "Department."
          },
          "phone": {
            "type": "string",
            "description": "Phone number."
          },
          "mobile": {
            "type": "string",
            "description": "Mobile phone number."
          },
          "email": {
            "type": "string",
            "description": "E-mail address. Must be a valid email if provided.",
            "format": "email"
          }
        },
        "example": {
          "relation_id": 1001,
          "initials": "J.",
          "firstname": "Jan",
          "surname_prefix": "de",
          "surname": "Vries",
          "gender": "m",
          "function": "Directeur",
          "email": "jan@voorbeeld.nl",
          "phone": "020-1234567",
          "mobile": "06-12345678"
        }
      },
      "PurchaseInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "number": {
            "type": "string",
            "description": "Invoice number."
          },
          "invoice_date": {
            "type": "string",
            "description": "Invoice date (YYYY-mm-dd).",
            "format": "date"
          },
          "expiry_date": {
            "type": "string",
            "description": "Expiry date (YYYY-mm-dd).",
            "format": "date"
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              },
              "paid": {
                "type": "number",
                "format": "float",
                "description": "Amount paid."
              },
              "open": {
                "type": "number",
                "format": "float",
                "description": "Open amount (unpaid)."
              }
            }
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "excl",
              "incl",
              "vat_shifted",
              "icv_outside_eu",
              "icv_within_eu"
            ]
          },
          "exported": {
            "type": "string",
            "description": "Whether the invoice has been exported (0 or 1)."
          },
          "export_date": {
            "type": "string",
            "description": "Export date (YYYY-mm-dd).",
            "format": "date",
            "nullable": true
          },
          "collect": {
            "type": "string",
            "description": "Whether the invoice is collected via direct debit (0 or 1)."
          },
          "last_payment_date": {
            "type": "string",
            "description": "Date of last payment (YYYY-mm-dd).",
            "format": "date",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of last edit."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the invoice was created."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this invoice in the Informer web app."
          },
          "status": {
            "type": "object",
            "description": "Invoice status.",
            "properties": {
              "status": {
                "type": "string",
                "description": "Status label."
              },
              "color": {
                "type": "string",
                "description": "Color indicator for this status.",
                "enum": [
                  "grey",
                  "green",
                  "orange",
                  "red",
                  "red-brown",
                  "darkred"
                ]
              }
            }
          },
          "lines": {
            "type": "array",
            "description": "Invoice line items.",
            "items": {
              "$ref": "#/components/schemas/PurchaseInvoiceLine"
            }
          }
        },
        "example": {
          "id": 99,
          "relation_id": 1001,
          "number": "INK-2024-001",
          "invoice_date": "2024-01-15",
          "expiry_date": "2024-02-14",
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "vat": 21.0,
            "paid": 0.0,
            "open": 121.0
          },
          "vat_option": "excl",
          "exported": "0",
          "export_date": null,
          "collect": "0",
          "last_payment_date": null,
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/purchase-invoice/99",
          "status": {
            "status": "Open",
            "ribbon": "orange"
          },
          "lines": [
            {
              "description": "Meellevering januari",
              "amount": 100.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 4000,
              "costs_id": null
            }
          ]
        }
      },
      "PurchaseInvoiceLine": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Line description."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Line amount."
          },
          "vat": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "VAT ID."
              },
              "percentage": {
                "type": "number",
                "format": "float",
                "description": "VAT percentage."
              }
            }
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID.",
            "nullable": true
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID.",
            "nullable": true
          }
        },
        "example": {
          "description": "Meellevering januari",
          "amount": 100.0,
          "vat": {
            "id": 1,
            "percentage": 21.0
          },
          "ledger_id": 4000,
          "costs_id": null
        }
      },
      "PurchaseInvoiceInput": {
        "type": "object",
        "required": [
          "relation_id",
          "invoice_date",
          "number",
          "vat_option",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID. Must be a valid relation in this administration."
          },
          "invoice_date": {
            "type": "string",
            "description": "Invoice date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "invoice_expiry_date": {
            "type": "string",
            "description": "Expiry date (format: YYYY-mm-dd). Defaults to invoice_date if not provided.",
            "format": "date"
          },
          "number": {
            "type": "string",
            "description": "Invoice number (as on the supplier's invoice)."
          },
          "collect": {
            "type": "integer",
            "description": "Whether the invoice is collected via direct debit (0 or 1).",
            "enum": [
              0,
              1
            ]
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option. Use /invoices/purchase/options to see which options are available.",
            "enum": [
              "excl",
              "incl",
              "vat_shifted",
              "icv_outside_eu",
              "icv_within_eu"
            ]
          },
          "pdf": {
            "type": "string",
            "description": "Optional base64-encoded PDF of the original invoice."
          },
          "lines": {
            "type": "array",
            "description": "Invoice line items.",
            "items": {
              "$ref": "#/components/schemas/PurchaseInvoiceLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "invoice_date": "2024-01-15",
          "invoice_expiry_date": "2024-02-14",
          "number": "INK-2024-001",
          "vat_option": "excl",
          "lines": [
            {
              "description": "Meellevering januari",
              "amount": 100.0,
              "vat_amount": 21.0,
              "vat_id": 1,
              "ledger_id": 4000
            }
          ]
        }
      },
      "PurchaseInvoiceLineInput": {
        "type": "object",
        "required": [
          "description",
          "amount",
          "vat_amount",
          "vat_id",
          "ledger_id"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Line description."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Line amount (excl or incl VAT depending on vat_option)."
          },
          "vat_amount": {
            "type": "number",
            "format": "float",
            "description": "VAT amount for this line. Must be 0 when vat_option is icv_outside_eu or icv_within_eu."
          },
          "vat_id": {
            "type": "integer",
            "description": "VAT ID. Must be valid for the selected vat_option."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID. Must be valid for the selected vat_id."
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID (optional). Required or disabled depending on the ledger account."
          }
        },
        "example": {
          "description": "Meellevering januari",
          "amount": 100.0,
          "vat_amount": 21.0,
          "vat_id": 1,
          "ledger_id": 4000
        }
      },
      "SalesInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "contact_id": {
            "type": "integer",
            "description": "Contact ID.",
            "nullable": true
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name.",
            "nullable": true
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID used."
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "number": {
            "type": "string",
            "description": "Full invoice number."
          },
          "invoice_date": {
            "type": "string",
            "description": "Invoice date (YYYY-mm-dd).",
            "format": "date"
          },
          "expiry_days": {
            "type": "integer",
            "description": "Number of days until expiry."
          },
          "expiry_date": {
            "type": "string",
            "description": "Expiry date (YYYY-mm-dd).",
            "format": "date"
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "excl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT in default currency."
              },
              "incl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT in default currency."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              },
              "paid": {
                "type": "number",
                "format": "float",
                "description": "Amount paid."
              },
              "open": {
                "type": "number",
                "format": "float",
                "description": "Open amount (unpaid)."
              }
            }
          },
          "payment_date": {
            "type": "string",
            "description": "Last payment date (YYYY-mm-dd).",
            "format": "date",
            "nullable": true
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID."
          },
          "comment": {
            "type": "string",
            "description": "Invoice comment.",
            "nullable": true
          },
          "footer": {
            "type": "string",
            "description": "Footer text.",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "description": "External reference.",
            "nullable": true
          },
          "concept": {
            "type": "string",
            "description": "1 = concept, 0 = finalized."
          },
          "reminder_status": {
            "type": "string",
            "description": "Reminder status.",
            "nullable": true
          },
          "last_reminder_date": {
            "type": "string",
            "description": "Date of last reminder sent.",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of last edit."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the invoice was created."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this invoice in the Informer web app."
          },
          "status": {
            "type": "object",
            "description": "Invoice status.",
            "properties": {
              "status": {
                "type": "string",
                "description": "Status label."
              },
              "color": {
                "type": "string",
                "description": "Color indicator for this status.",
                "enum": [
                  "grey",
                  "green",
                  "orange",
                  "red",
                  "red-brown",
                  "darkred"
                ]
              }
            }
          },
          "send_options": {
            "type": "object",
            "description": "Available send methods for this invoice.",
            "properties": {
              "email": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Available email addresses."
              },
              "peppol": {
                "type": "boolean",
                "description": "Whether Peppol is available."
              }
            }
          },
          "attachments": {
            "type": "array",
            "description": "IDs of shared library attachments linked to this invoice. Managed by sending the desired list in the 'attachments' field of a PUT request (omit an ID to remove it from the invoice).",
            "items": {
              "type": "integer"
            }
          },
          "document_attachments": {
            "type": "array",
            "description": "Invoice-specific attachments uploaded via POST /invoices/sales/{id}/attachments. Removed via DELETE /invoices/sales/{id}/attachments/{attachment_id}. These cannot be managed through the 'attachments' field.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "filename": {
                  "type": "string"
                },
                "description": {
                  "type": "string",
                  "nullable": true
                },
                "file": {
                  "type": "string",
                  "description": "Stored filename."
                },
                "size": {
                  "type": "integer",
                  "description": "File size in bytes."
                }
              }
            }
          },
          "lines": {
            "type": "array",
            "description": "Invoice line items.",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          }
        },
        "example": {
          "id": 12345,
          "relation_id": 1001,
          "contact_id": null,
          "contact_name": null,
          "template_id": 1,
          "payment_condition_id": 1,
          "number": "2024-001",
          "invoice_date": "2024-01-15",
          "expiry_days": 30,
          "expiry_date": "2024-02-14",
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "excl_vat_default": 100.0,
            "incl_vat_default": 121.0,
            "vat": 21.0,
            "paid": 0.0,
            "open": 121.0
          },
          "payment_date": null,
          "vat_option": "excl",
          "currency_id": 1,
          "comment": null,
          "footer": null,
          "reference": "PO-2024-001",
          "concept": "0",
          "reminder_status": null,
          "last_reminder_date": null,
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/sales-invoice/12345",
          "status": {
            "status": "Open",
            "ribbon": "orange"
          },
          "send_options": {
            "email": [
              "facturen@voorbeeld.nl"
            ],
            "peppol": false
          },
          "attachments": [],
          "document_attachments": [],
          "lines": [
            {
              "info": "0",
              "qty": 2,
              "product_id": null,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "discount": 0.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 8000
            }
          ]
        }
      },
      "SalesInvoiceInput": {
        "type": "object",
        "required": [
          "relation_id",
          "invoice_date",
          "payment_condition_id",
          "currency_id",
          "vat_option",
          "template_id",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID. Must be a valid relation in this administration."
          },
          "contact_name": {
            "type": "string",
            "description": "Free text contact name (optional). This is not a reference to an existing contact — the value is stored and displayed as-is on the invoice."
          },
          "reference": {
            "type": "string",
            "description": "External reference (optional)."
          },
          "invoice_date": {
            "type": "string",
            "description": "Invoice date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "delivery_date": {
            "type": "string",
            "description": "Delivery date (format: YYYY-mm-dd). Required for AT and DE administrations.",
            "format": "date"
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID. Must be a valid payment condition in this administration."
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID. Must be a valid currency in this administration."
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option. Must match the VAT IDs used in lines.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID. Must be a valid sales_invoice template in this administration."
          },
          "comment": {
            "type": "string",
            "description": "Invoice comment (optional)."
          },
          "footer": {
            "type": "string",
            "description": "Footer text (optional)."
          },
          "attachments": {
            "type": "array",
            "description": "Array of attachment IDs to include (leave this field out if you want to keep existing attachments during a PUT call).",
            "items": {
              "type": "integer"
            }
          },
          "lines": {
            "type": "array",
            "description": "Invoice line items. Each line is either a regular line or an info line.",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "invoice_date": "2024-01-15",
          "payment_condition_id": 1,
          "currency_id": 1,
          "vat_option": "excl",
          "template_id": 1,
          "reference": "PO-2024-001",
          "lines": [
            {
              "info": false,
              "qty": 2,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "vat_id": 1,
              "ledger_id": 8000
            }
          ]
        }
      },
      "RecurringInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "contact_id": {
            "type": "integer",
            "description": "Contact ID.",
            "nullable": true
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name.",
            "nullable": true
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID used."
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "excl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT in default currency."
              },
              "incl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT in default currency."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              }
            }
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID."
          },
          "comment": {
            "type": "string",
            "description": "Comment.",
            "nullable": true
          },
          "footer": {
            "type": "string",
            "description": "Footer text.",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "description": "External reference.",
            "nullable": true
          },
          "subscription": {
            "type": "object",
            "properties": {
              "number": {
                "type": "string",
                "description": "Recurring invoice number.",
                "nullable": true
              },
              "type_id": {
                "type": "integer",
                "description": "Subscription type ID.",
                "nullable": true
              },
              "frequency": {
                "type": "string",
                "description": "Billing frequency.",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "fourweeks",
                  "twomonths",
                  "quarter",
                  "fourmonths",
                  "half-year",
                  "year"
                ]
              },
              "start_date": {
                "type": "string",
                "description": "Recurring invoice start date (YYYY-mm-dd).",
                "format": "date"
              },
              "invoice_date": {
                "type": "string",
                "description": "Next invoice date (YYYY-mm-dd).",
                "format": "date",
                "nullable": true
              },
              "end_date": {
                "type": "string",
                "description": "Recurring invoice end date (YYYY-mm-dd). Null if no end date.",
                "format": "date",
                "nullable": true
              },
              "restriction": {
                "type": "string",
                "description": "1 = limited number of invoices, 0 = unlimited."
              },
              "times": {
                "type": "integer",
                "description": "Maximum number of invoices to generate (when restriction = 1).",
                "nullable": true
              },
              "auto_send": {
                "type": "string",
                "description": "1 = automatically send generated invoices, 0 = create as concept."
              }
            }
          },
          "last_edit": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of last edit."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the recurring invoice was created."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this recurring invoice in the Informer web app."
          },
          "attachments": {
            "type": "array",
            "description": "List of attachment filenames linked to this recurring invoice.",
            "items": {
              "type": "string"
            }
          },
          "lines": {
            "type": "array",
            "description": "Recurring invoice line items.",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          }
        },
        "example": {
          "id": 42,
          "relation_id": 1001,
          "contact_id": null,
          "contact_name": null,
          "template_id": 1,
          "payment_condition_id": 1,
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "excl_vat_default": 100.0,
            "incl_vat_default": 121.0,
            "vat": 21.0
          },
          "vat_option": "excl",
          "currency_id": 1,
          "comment": null,
          "footer": null,
          "reference": null,
          "subscription": {
            "number": null,
            "type_id": null,
            "frequency": "month",
            "start_date": "2024-01-01",
            "invoice_date": "2024-02-01",
            "end_date": null,
            "restriction": "0",
            "times": null,
            "auto_send": "0"
          },
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/recurring-invoice/42",
          "attachments": [],
          "lines": [
            {
              "info": "0",
              "qty": 2,
              "product_id": null,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "discount": 0.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 8000
            }
          ]
        }
      },
      "RecurringInvoiceInput": {
        "type": "object",
        "required": [
          "relation_id",
          "payment_condition_id",
          "currency_id",
          "vat_option",
          "template_id",
          "subscription",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID. Must be a valid relation in this administration."
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name (optional)."
          },
          "reference": {
            "type": "string",
            "description": "External reference (optional)."
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID. Must be a valid payment condition in this administration."
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID. Must be a valid currency in this administration."
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option. Must match the VAT IDs used in lines.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID. Must be a valid sales_invoice template in this administration."
          },
          "comment": {
            "type": "string",
            "description": "Comment (optional)."
          },
          "footer": {
            "type": "string",
            "description": "Footer text (optional)."
          },
          "attachments": {
            "type": "array",
            "description": "Array of attachment IDs to include (leave this field out if you want to keep existing attachments during a PUT call).",
            "items": {
              "type": "integer"
            }
          },
          "subscription": {
            "type": "object",
            "required": [
              "frequency",
              "start_date"
            ],
            "description": "Recurring invoice schedule settings.",
            "properties": {
              "type_id": {
                "type": "integer",
                "description": "Subscription type ID (optional). Must be a valid subscription type in this administration."
              },
              "number": {
                "type": "string",
                "description": "Recurring invoice number (optional)."
              },
              "frequency": {
                "type": "string",
                "description": "Billing frequency.",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "fourweeks",
                  "twomonths",
                  "quarter",
                  "fourmonths",
                  "half-year",
                  "year"
                ]
              },
              "start_date": {
                "type": "string",
                "description": "Recurring invoice start date (format: YYYY-mm-dd).",
                "format": "date"
              },
              "invoice_date": {
                "type": "string",
                "description": "Next invoice date (format: YYYY-mm-dd). Defaults to start_date if not provided.",
                "format": "date"
              },
              "end_date": {
                "type": "string",
                "description": "Recurring invoice end date (format: YYYY-mm-dd). Leave empty for no end date.",
                "format": "date"
              },
              "restriction": {
                "type": "boolean",
                "description": "Whether to limit the number of generated invoices (optional, default: false)."
              },
              "times": {
                "type": "integer",
                "description": "Maximum number of invoices to generate. Only used when restriction = true."
              },
              "auto_send": {
                "type": "boolean",
                "description": "Automatically send generated invoices (optional, default: false)."
              }
            }
          },
          "lines": {
            "type": "array",
            "description": "Recurring invoice line items. Each line is either a regular line or an info line.",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "payment_condition_id": 1,
          "currency_id": 1,
          "vat_option": "excl",
          "template_id": 1,
          "subscription": {
            "frequency": "month",
            "start_date": "2024-01-01",
            "auto_send": false
          },
          "lines": [
            {
              "info": false,
              "qty": 1,
              "description": "Maandabonnement",
              "amount": 100.0,
              "vat_id": 1,
              "ledger_id": 8000
            }
          ]
        }
      },
      "InvoiceLine": {
        "type": "object",
        "properties": {
          "info": {
            "type": "boolean",
            "description": "true = info line (text-only, no amounts), false = regular line."
          },
          "qty": {
            "type": "integer",
            "description": "Quantity (null for info lines).",
            "nullable": true
          },
          "product_id": {
            "type": "integer",
            "description": "Product ID (when trade module is active).",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Line description."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Unit price.",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "format": "float",
            "description": "Discount percentage.",
            "nullable": true
          },
          "vat": {
            "type": "object",
            "description": "VAT information for this line.",
            "properties": {
              "id": {
                "type": "integer",
                "description": "VAT ID."
              },
              "percentage": {
                "type": "number",
                "format": "float",
                "description": "VAT percentage."
              }
            }
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID.",
            "nullable": true
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID.",
            "nullable": true
          }
        },
        "example": {
          "info": "0",
          "qty": 2,
          "product_id": null,
          "description": "Broodlevering week 3",
          "amount": 50.0,
          "discount": 0.0,
          "vat": {
            "id": 1,
            "percentage": 21.0
          },
          "ledger_id": 8000
        }
      },
      "InvoiceLineInput": {
        "type": "object",
        "description": "For a regular line: set info=false with qty, description, amount, vat_id, ledger_id. For an info line: set info=true with only description.",
        "properties": {
          "qty": {
            "type": "integer",
            "description": "Quantity (required for regular lines)."
          },
          "info": {
            "type": "boolean",
            "description": "true = info/text line, false = regular line."
          },
          "description": {
            "type": "string",
            "description": "Line description (required)."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Unit price (required for regular lines). Whether this is incl. or excl. VAT depends on the vat_option of the invoice: use incl. VAT when vat_option=incl, excl. VAT for all other options."
          },
          "discount": {
            "type": "integer",
            "description": "Discount percentage (optional, default = 0)."
          },
          "vat_id": {
            "type": "integer",
            "description": "VAT ID (required for regular lines). Must be valid for the selected vat_option."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID (required for regular lines). Must be valid for the selected vat_id."
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID (optional). Required or disabled depending on the ledger account."
          },
          "product_id": {
            "type": "integer",
            "description": "Product ID (required when trade module is active)."
          }
        },
        "example": {
          "info": false,
          "qty": 2,
          "description": "Broodlevering week 3",
          "amount": 50.0,
          "discount": 0,
          "vat_id": 1,
          "ledger_id": 8000
        }
      },
      "SalesOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "contact_id": {
            "type": "integer",
            "description": "Contact ID.",
            "nullable": true
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name.",
            "nullable": true
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID."
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "number": {
            "type": "string",
            "description": "Full order number."
          },
          "order_date": {
            "type": "string",
            "description": "Order date (YYYY-mm-dd).",
            "format": "date"
          },
          "expiry_days": {
            "type": "integer",
            "description": "Number of days until expiry."
          },
          "expiry_date": {
            "type": "string",
            "description": "Expiry date (YYYY-mm-dd).",
            "format": "date"
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              }
            }
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID."
          },
          "comment": {
            "type": "string",
            "description": "Order comment.",
            "nullable": true
          },
          "footer": {
            "type": "string",
            "description": "Footer text.",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "description": "External reference.",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of last edit."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the order was created."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this order in the Informer web app."
          },
          "status": {
            "type": "object",
            "description": "Order status.",
            "properties": {
              "status": {
                "type": "string",
                "description": "Status label."
              },
              "color": {
                "type": "string",
                "description": "Color indicator for this status.",
                "enum": [
                  "grey",
                  "green",
                  "orange",
                  "red",
                  "darkred"
                ]
              }
            }
          },
          "send_options": {
            "type": "object",
            "description": "Available send methods (email only, no Peppol for orders).",
            "properties": {
              "email": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "attachments": {
            "type": "array",
            "description": "List of attachment filenames linked to this order.",
            "items": {
              "type": "string"
            }
          },
          "lines": {
            "type": "array",
            "description": "Order line items.",
            "items": {
              "$ref": "#/components/schemas/OrderLine"
            }
          }
        },
        "example": {
          "id": 99,
          "relation_id": 1001,
          "contact_id": null,
          "contact_name": null,
          "template_id": 1,
          "payment_condition_id": 1,
          "number": "OR-2024-001",
          "order_date": "2024-01-15",
          "expiry_days": 30,
          "expiry_date": "2024-02-14",
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "vat": 21.0
          },
          "vat_option": "excl",
          "currency_id": 1,
          "comment": null,
          "footer": null,
          "reference": null,
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/sales-order/99",
          "status": {
            "status": "Onderhanden",
            "ribbon": "blue"
          },
          "send_options": {
            "email": [
              "facturen@voorbeeld.nl"
            ]
          },
          "attachments": [],
          "lines": [
            {
              "info": "0",
              "qty": 2,
              "product_id": null,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "discount": 0.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 8000,
              "delivered": 0
            }
          ]
        }
      },
      "OrderLine": {
        "allOf": [
          {
            "$ref": "#/components/schemas/InvoiceLine"
          },
          {
            "type": "object",
            "properties": {
              "delivered": {
                "type": "integer",
                "description": "Quantity delivered."
              }
            }
          }
        ],
        "example": {
          "info": "0",
          "qty": 2,
          "product_id": null,
          "description": "Broodlevering week 3",
          "amount": 50.0,
          "discount": 0.0,
          "vat": {
            "id": 1,
            "percentage": 21.0
          },
          "ledger_id": 8000,
          "delivered": 0
        }
      },
      "SalesOrderInput": {
        "type": "object",
        "required": [
          "relation_id",
          "order_date",
          "payment_condition_id",
          "currency_id",
          "vat_option",
          "template_id",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID. Must be a valid relation in this administration."
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name (optional)."
          },
          "reference": {
            "type": "string",
            "description": "External reference (optional)."
          },
          "order_date": {
            "type": "string",
            "description": "Order date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "delivery_date": {
            "type": "string",
            "description": "Delivery date (format: YYYY-mm-dd). Required for AT and DE administrations.",
            "format": "date"
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID."
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID. Must be a valid sales_order template."
          },
          "comment": {
            "type": "string",
            "description": "Order comment (optional)."
          },
          "footer": {
            "type": "string",
            "description": "Footer text (optional)."
          },
          "attachments": {
            "type": "array",
            "description": "Array of attachment IDs to include (leave this field out if you want to keep existing attachments during a PUT call).",
            "items": {
              "type": "integer"
            }
          },
          "lines": {
            "type": "array",
            "description": "Order line items.",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "order_date": "2024-01-15",
          "payment_condition_id": 1,
          "currency_id": 1,
          "vat_option": "excl",
          "template_id": 1,
          "lines": [
            {
              "info": false,
              "qty": 2,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "vat_id": 1,
              "ledger_id": 8000
            }
          ]
        }
      },
      "Quotation": {
        "type": "object",
        "description": "Quotation details. Structure is identical to SalesInvoice.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer"
          },
          "contact_id": {
            "type": "integer",
            "nullable": true
          },
          "contact_name": {
            "type": "string",
            "nullable": true
          },
          "template_id": {
            "type": "integer"
          },
          "payment_condition_id": {
            "type": "integer"
          },
          "number": {
            "type": "string",
            "description": "Full quotation number."
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "expiry_days": {
            "type": "integer"
          },
          "expiry_date": {
            "type": "string",
            "format": "date"
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "excl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT in default currency."
              },
              "incl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT in default currency."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              },
              "paid": {
                "type": "number",
                "format": "float",
                "description": "Amount paid."
              }
            }
          },
          "payment_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "vat_option": {
            "type": "string",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "currency_id": {
            "type": "integer"
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "footer": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "concept": {
            "type": "string"
          },
          "reminder_status": {
            "type": "string",
            "nullable": true
          },
          "last_reminder_date": {
            "type": "string",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the quotation was created."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to this quotation in the Informer web app."
          },
          "status": {
            "type": "object",
            "description": "Quotation status.",
            "properties": {
              "status": {
                "type": "string",
                "description": "Status label."
              },
              "color": {
                "type": "string",
                "description": "Color indicator for this status.",
                "enum": [
                  "grey",
                  "orange",
                  "yellow",
                  "red",
                  "red-brown",
                  "darkred",
                  "darkyellow",
                  "green"
                ]
              }
            }
          },
          "send_options": {
            "type": "object",
            "properties": {
              "email": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "attachments": {
            "type": "array",
            "description": "List of attachment filenames linked to this quotation.",
            "items": {
              "type": "string"
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          }
        },
        "example": {
          "id": 77,
          "relation_id": 1001,
          "contact_id": null,
          "contact_name": null,
          "template_id": 1,
          "payment_condition_id": 1,
          "number": "OF-2024-001",
          "invoice_date": "2024-01-15",
          "expiry_days": 30,
          "expiry_date": "2024-02-14",
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "excl_vat_default": 100.0,
            "incl_vat_default": 121.0,
            "vat": 21.0,
            "paid": 0.0
          },
          "payment_date": null,
          "vat_option": "excl",
          "currency_id": 1,
          "comment": null,
          "footer": null,
          "reference": null,
          "concept": "0",
          "reminder_status": null,
          "last_reminder_date": null,
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/quotation/77",
          "status": {
            "status": "Verzonden",
            "ribbon": "blue"
          },
          "send_options": {
            "email": [
              "facturen@voorbeeld.nl"
            ]
          },
          "attachments": [],
          "lines": [
            {
              "info": "0",
              "qty": 2,
              "product_id": null,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "discount": 0.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 8000
            }
          ]
        }
      },
      "QuotationInput": {
        "type": "object",
        "required": [
          "relation_id",
          "invoice_date",
          "payment_condition_id",
          "currency_id",
          "vat_option",
          "template_id",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name (optional)."
          },
          "reference": {
            "type": "string",
            "description": "External reference (optional)."
          },
          "invoice_date": {
            "type": "string",
            "description": "Quotation date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "delivery_date": {
            "type": "string",
            "description": "Delivery date (format: YYYY-mm-dd). Required for AT and DE administrations.",
            "format": "date"
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "currency_id": {
            "type": "integer",
            "description": "Currency ID."
          },
          "vat_option": {
            "type": "string",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "template_id": {
            "type": "integer",
            "description": "Template ID."
          },
          "comment": {
            "type": "string"
          },
          "footer": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "description": "Array of attachment IDs to include (leave this field out if you want to keep existing attachments during a PUT call).",
            "items": {
              "type": "integer"
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "invoice_date": "2024-01-15",
          "payment_condition_id": 1,
          "currency_id": 1,
          "vat_option": "excl",
          "template_id": 1,
          "lines": [
            {
              "info": false,
              "qty": 2,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "vat_id": 1,
              "ledger_id": 8000
            }
          ]
        }
      },
      "SalesbookInvoice": {
        "type": "object",
        "description": "Salesbook invoice details. Structure is similar to SalesInvoice but without send_options.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "relation_id": {
            "type": "integer"
          },
          "contact_id": {
            "type": "integer",
            "nullable": true
          },
          "contact_name": {
            "type": "string",
            "nullable": true
          },
          "template_id": {
            "type": "integer"
          },
          "payment_condition_id": {
            "type": "integer"
          },
          "number": {
            "type": "string",
            "description": "Full invoice number."
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "expiry_days": {
            "type": "integer"
          },
          "expiry_date": {
            "type": "string",
            "format": "date"
          },
          "totals": {
            "type": "object",
            "properties": {
              "excl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT."
              },
              "incl_vat": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT."
              },
              "excl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount excluding VAT in default currency."
              },
              "incl_vat_default": {
                "type": "number",
                "format": "float",
                "description": "Total amount including VAT in default currency."
              },
              "vat": {
                "type": "number",
                "format": "float",
                "description": "Total VAT amount."
              },
              "paid": {
                "type": "number",
                "format": "float",
                "description": "Amount paid."
              }
            }
          },
          "payment_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "vat_option": {
            "type": "string",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "currency_id": {
            "type": "integer"
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "footer": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "concept": {
            "type": "string"
          },
          "reminder_status": {
            "type": "string",
            "nullable": true
          },
          "last_reminder_date": {
            "type": "string",
            "nullable": true
          },
          "last_edit": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the invoice was created."
          },
          "url": {
            "type": "string"
          },
          "status": {
            "type": "object",
            "description": "Invoice status.",
            "properties": {
              "status": {
                "type": "string",
                "description": "Status label."
              },
              "color": {
                "type": "string",
                "description": "Color indicator for this status.",
                "enum": [
                  "grey",
                  "green",
                  "orange",
                  "red",
                  "red-brown",
                  "darkred"
                ]
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          }
        },
        "example": {
          "id": 55,
          "relation_id": 1001,
          "contact_id": null,
          "contact_name": null,
          "template_id": 1,
          "payment_condition_id": 1,
          "number": "SB-2024-001",
          "invoice_date": "2024-01-15",
          "expiry_days": 30,
          "expiry_date": "2024-02-14",
          "totals": {
            "excl_vat": 100.0,
            "incl_vat": 121.0,
            "excl_vat_default": 100.0,
            "incl_vat_default": 121.0,
            "vat": 21.0,
            "paid": 0.0
          },
          "payment_date": null,
          "vat_option": "excl",
          "currency_id": 1,
          "comment": null,
          "footer": null,
          "reference": null,
          "concept": "0",
          "reminder_status": null,
          "last_reminder_date": null,
          "last_edit": "2024-01-15 09:30:00",
          "created_at": "2024-01-15 09:00:00",
          "url": "https://app.informer.eu/salesbook/55",
          "status": {
            "status": "Open",
            "ribbon": "orange"
          },
          "lines": [
            {
              "info": "0",
              "qty": 2,
              "product_id": null,
              "description": "Broodlevering week 3",
              "amount": 50.0,
              "discount": 0.0,
              "vat": {
                "id": 1,
                "percentage": 21.0
              },
              "ledger_id": 8000
            }
          ]
        }
      },
      "SalesbookInput": {
        "type": "object",
        "required": [
          "relation_id",
          "number",
          "invoice_date",
          "expiry_date",
          "payment_condition_id",
          "vat_option",
          "invoice_amount",
          "lines"
        ],
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Relation ID."
          },
          "number": {
            "type": "string",
            "description": "Custom invoice number."
          },
          "invoice_date": {
            "type": "string",
            "description": "Invoice date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "expiry_date": {
            "type": "string",
            "description": "Expiry date (format: YYYY-mm-dd).",
            "format": "date"
          },
          "delivery_date": {
            "type": "string",
            "description": "Delivery date (format: YYYY-mm-dd). Required for AT and DE administrations.",
            "format": "date"
          },
          "payment_condition_id": {
            "type": "integer",
            "description": "Payment condition ID."
          },
          "vat_option": {
            "type": "string",
            "description": "VAT calculation option.",
            "enum": [
              "incl",
              "excl",
              "shifted",
              "icv_within_eu",
              "icv_outside_eu"
            ]
          },
          "invoice_amount": {
            "type": "number",
            "format": "float",
            "description": "Total invoice amount."
          },
          "pdf": {
            "type": "string",
            "description": "Optional base64-encoded PDF file to attach."
          },
          "lines": {
            "type": "array",
            "description": "Invoice line items.",
            "items": {
              "$ref": "#/components/schemas/SalesbookLineInput"
            }
          }
        },
        "example": {
          "relation_id": 1001,
          "number": "SB-2024-001",
          "invoice_date": "2024-01-15",
          "expiry_date": "2024-02-14",
          "payment_condition_id": 1,
          "vat_option": "excl",
          "invoice_amount": 121.0,
          "lines": [
            {
              "description": "Levering januari",
              "amount": 100.0,
              "vat_id": 1,
              "ledger_id": 8000
            }
          ]
        }
      },
      "SalesbookLineInput": {
        "type": "object",
        "required": [
          "description",
          "amount",
          "vat_id",
          "ledger_id"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Line description."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Line amount."
          },
          "vat_id": {
            "type": "integer",
            "description": "VAT ID. Must be valid for the selected vat_option."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID. Must be valid for the selected vat_id."
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID (optional)."
          }
        },
        "example": {
          "description": "Levering januari",
          "amount": 100.0,
          "vat_id": 1,
          "ledger_id": 8000
        }
      },
      "VatLedgerOption": {
        "type": "object",
        "description": "VAT rate with its compatible options and ledger accounts.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "name": {
            "type": "string",
            "description": "VAT rate name."
          },
          "percentage": {
            "type": "number",
            "format": "float",
            "description": "VAT percentage."
          },
          "vat_options": {
            "type": "object",
            "description": "Which vat_option values this rate can be used with.",
            "properties": {
              "incl": {
                "type": "boolean"
              },
              "excl": {
                "type": "boolean"
              },
              "shifted": {
                "type": "boolean"
              },
              "icv_within_eu": {
                "type": "boolean"
              },
              "icv_outside_eu": {
                "type": "boolean"
              }
            }
          },
          "usable_ledgers": {
            "type": "array",
            "description": "Compatible ledger accounts.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Ledger account ID."
                },
                "number": {
                  "type": "string",
                  "description": "Ledger account number."
                },
                "description": {
                  "type": "string",
                  "description": "Ledger account description."
                },
                "costs": {
                  "type": "string",
                  "description": "Cost centre requirement: 'optional', 'required' or 'disabled'.",
                  "enum": [
                    "optional",
                    "required",
                    "disabled"
                  ]
                }
              }
            }
          }
        },
        "example": {
          "id": 1,
          "name": "Hoog tarief",
          "percentage": 21.0,
          "vat_options": {
            "incl": true,
            "excl": true,
            "shifted": false,
            "icv_within_eu": false,
            "icv_outside_eu": false
          },
          "usable_ledgers": [
            {
              "id": 8000,
              "description": "Omzet hoog",
              "type": "sales"
            }
          ]
        }
      },
      "PaymentCondition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "description": {
            "type": "string",
            "description": "Payment condition description."
          },
          "payment_option": {
            "type": "string",
            "description": "Payment option type (e.g. 'invoice', 'collection')."
          },
          "days": {
            "type": "integer",
            "description": "Number of days until payment is due."
          },
          "footer_text_invoice": {
            "type": "string",
            "description": "Footer text for invoices.",
            "nullable": true
          },
          "footer_text_quotation": {
            "type": "string",
            "description": "Footer text for quotations.",
            "nullable": true
          },
          "default": {
            "type": "string",
            "description": "Whether this is the default payment condition (1 = default)."
          }
        },
        "example": {
          "id": 1,
          "description": "14 dagen netto",
          "payment_option": "invoice",
          "days": 14,
          "footer_text_invoice": "Gelieve binnen 14 dagen te betalen.",
          "footer_text_quotation": null
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "description": {
            "type": "string",
            "description": "Template description/name."
          },
          "type": {
            "type": "string",
            "description": "Template type.",
            "enum": [
              "sales_invoice",
              "sales_order",
              "quotation"
            ]
          },
          "default": {
            "type": "boolean",
            "description": "Whether this is the default template for its type."
          }
        },
        "example": {
          "id": 1,
          "description": "Standaard factuursjabloon",
          "type": "sales_invoice",
          "default": true
        }
      },
      "Vat": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "name": {
            "type": "string",
            "description": "VAT rate name."
          },
          "percentage": {
            "type": "number",
            "format": "float",
            "description": "VAT percentage."
          },
          "invoice_type": {
            "type": "string",
            "description": "Invoice type (1 = sales, 2 = purchase)."
          },
          "vat_code": {
            "type": "string",
            "description": "VAT ledger code.",
            "nullable": true
          },
          "vat_shifted": {
            "type": "string",
            "description": "Whether this is a VAT shifted rate (0 or 1)."
          },
          "available": {
            "type": "string",
            "description": "Availability status (1 = active, 0 = inactive)."
          }
        },
        "example": {
          "id": 1,
          "name": "Hoog tarief",
          "percentage": 21.0,
          "invoice_type": "1",
          "vat_code": "VH",
          "vat_shifted": "0",
          "available": true
        }
      },
      "Ledger": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "number": {
            "type": "string",
            "description": "Ledger account number."
          },
          "description": {
            "type": "string",
            "description": "Ledger account description."
          },
          "type": {
            "type": "string",
            "description": "Account type."
          },
          "category": {
            "type": "string",
            "description": "Account category."
          },
          "vat_code": {
            "type": "string",
            "description": "VAT code linked to this account.",
            "nullable": true
          },
          "costs": {
            "type": "string",
            "description": "Cost centre setting: 'optional', 'required' or 'disabled'.",
            "enum": [
              "optional",
              "required",
              "disabled"
            ]
          },
          "rgs": {
            "type": "string",
            "description": "RGS reference code.",
            "nullable": true
          },
          "blocked": {
            "type": "string",
            "description": "Whether the account is blocked (0 or 1)."
          },
          "condensation_1": {
            "type": "object",
            "description": "First condensation level.",
            "properties": {
              "code": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "condensation_2": {
            "type": "object",
            "description": "Second condensation level.",
            "properties": {
              "code": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "condensation_3": {
            "type": "object",
            "description": "Third condensation level.",
            "properties": {
              "code": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "id": 1,
          "number": "8000",
          "description": "Omzet",
          "type": "revenue",
          "category": "Winst en verlies",
          "vat_code": "VH",
          "costs": "0",
          "rgs": null,
          "blocked": false,
          "condensation_1": null,
          "condensation_2": null,
          "condensation_3": null
        }
      },
      "CostCentre": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "number": {
            "type": "string",
            "description": "Cost centre number."
          },
          "description": {
            "type": "string",
            "description": "Cost centre description."
          }
        },
        "example": {
          "id": 1,
          "number": "100",
          "description": "Afdeling Verkoop"
        }
      },
      "Currency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "currency": {
            "type": "string",
            "description": "Currency code (e.g. EUR, USD, GBP)."
          },
          "description": {
            "type": "string",
            "description": "Currency description."
          },
          "rate": {
            "type": "number",
            "format": "float",
            "description": "Exchange rate."
          },
          "autoupdate": {
            "type": "string",
            "description": "Whether the rate is automatically updated (0 or 1)."
          },
          "journal_id": {
            "type": "integer",
            "description": "Linked journal ID.",
            "nullable": true
          },
          "ledger_id": {
            "type": "integer",
            "description": "Linked ledger ID.",
            "nullable": true
          }
        },
        "example": {
          "id": 1,
          "currency": "EUR",
          "description": "Euro",
          "rate": 1.0,
          "autoupdate": "0",
          "journal_id": null,
          "ledger_id": null
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "filename": {
            "type": "string",
            "description": "Original filename."
          },
          "description": {
            "type": "string",
            "description": "Attachment description."
          },
          "file": {
            "type": "string",
            "description": "File reference."
          },
          "default": {
            "description": "Document types for which this attachment is included by default (e.g. ['sales_invoice', 'quotation']).",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "example": {
          "id": 1,
          "filename": "algemene_voorwaarden.pdf",
          "description": "Algemene voorwaarden",
          "file": "av_2024.pdf",
          "default": [
            "sales_invoice",
            "quotation"
          ]
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "product_code_sales": {
            "type": "string",
            "description": "Product code for sales."
          },
          "description_sales": {
            "type": "string",
            "description": "Product description for sales."
          },
          "product_type": {
            "type": "string",
            "description": "Product type."
          },
          "amount_sales": {
            "type": "number",
            "format": "float",
            "description": "Sales price."
          },
          "vat_id_sales": {
            "type": "integer",
            "description": "VAT ID for sales."
          },
          "ledger_id_sales": {
            "type": "integer",
            "description": "Ledger ID for sales."
          },
          "suppliers": {
            "type": "array",
            "description": "Supplier information for this product.",
            "items": {
              "$ref": "#/components/schemas/ProductSupplier"
            }
          }
        },
        "example": {
          "id": 1,
          "product_code_sales": "BR-001",
          "description_sales": "Volkoren brood",
          "product_type": "product",
          "amount_sales": 3.5,
          "vat_id_sales": 1,
          "ledger_id_sales": 8000,
          "suppliers": [
            {
              "relation_id": 2001,
              "product_code": "MEEL-001",
              "product_description": "Tarwebloem 25kg",
              "product_price": 18.5,
              "product_tax_id": 1
            }
          ]
        }
      },
      "ProductSupplier": {
        "type": "object",
        "properties": {
          "relation_id": {
            "type": "integer",
            "description": "Supplier relation ID."
          },
          "product_code": {
            "type": "string",
            "description": "Supplier's product code."
          },
          "product_description": {
            "type": "string",
            "description": "Supplier's product description."
          },
          "product_price": {
            "type": "number",
            "format": "float",
            "description": "Purchase price from supplier."
          },
          "product_tax_id": {
            "type": "integer",
            "description": "VAT ID for purchases."
          },
          "product_ledger_id": {
            "type": "integer",
            "description": "Ledger ID for purchases."
          },
          "default": {
            "type": "string",
            "description": "Whether this is the default supplier (0 or 1)."
          }
        },
        "example": {
          "relation_id": 2001,
          "product_code": "MEEL-001",
          "product_description": "Tarwebloem 25kg",
          "product_price": 18.5,
          "product_tax_id": 1
        }
      },
      "Journal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "number": {
            "type": "integer",
            "description": "Journal number."
          },
          "description": {
            "type": "string",
            "description": "Journal description."
          },
          "type": {
            "type": "string",
            "description": "Journal type (e.g. sales, purchase, cash, bank)."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Contra ledger account ID linked to this journal."
          }
        },
        "example": {
          "id": 1,
          "number": 10,
          "description": "Verkoopboek",
          "type": "sales",
          "ledger_id": 1300
        }
      },
      "SubscriptionType": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Subscription type code."
          },
          "name": {
            "type": "string",
            "description": "Subscription type name."
          },
          "description": {
            "type": "string",
            "description": "Additional description or notes for this subscription type."
          }
        },
        "example": {
          "code": "MAAND",
          "name": "Maandabonnement",
          "description": "Maandelijks terugkerende factuur"
        }
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Date of the receipt (YYYY-mm-dd)."
          },
          "payment_type": {
            "type": "string",
            "enum": [
              "bank",
              "cash"
            ],
            "description": "Payment method: bank (pin) or cash (kas)."
          },
          "description": {
            "type": "string",
            "description": "Description of the receipt."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Total amount of the receipt."
          },
          "paid": {
            "type": "number",
            "format": "float",
            "description": "Amount already processed via journal entries."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID linked to this receipt. Retrieve valid IDs from GET /ledgers."
          }
        },
        "example": {
          "id": 1,
          "date": "2026-03-14",
          "payment_type": "bank",
          "description": "Kantoorbenodigdheden",
          "amount": 24.95,
          "paid": 0,
          "ledger_id": 4100
        }
      },
      "ReceiptInput": {
        "type": "object",
        "required": [
          "date",
          "payment_type"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Date of the receipt (YYYY-mm-dd)."
          },
          "payment_type": {
            "type": "string",
            "enum": [
              "bank",
              "cash"
            ],
            "description": "Payment method: bank (pin) or cash (kas)."
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Total amount of the receipt."
          },
          "description": {
            "type": "string",
            "description": "Description of the receipt."
          },
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID to link to this receipt. Retrieve valid IDs from GET /ledgers."
          },
          "pdf": {
            "type": "string",
            "description": "Optional base64-encoded PDF file to attach to this receipt."
          }
        },
        "example": {
          "date": "2026-03-14",
          "payment_type": "bank",
          "amount": 24.95,
          "description": "Kantoorbenodigdheden",
          "ledger_id": 4100
        }
      },
      "SendInvoiceRequest": {
        "type": "object",
        "required": [
          "method"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Send method.",
            "enum": [
              "email",
              "mark",
              "peppol"
            ]
          },
          "email_address": {
            "type": "string",
            "description": "E-mail address to send to (required when method = email). Must be a valid email address associated with the relation.",
            "format": "email"
          }
        },
        "example": {
          "method": "email",
          "email_address": "facturen@voorbeeld.nl"
        }
      },
      "SendOrderRequest": {
        "type": "object",
        "required": [
          "method"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Send method. Peppol is not available for sales orders.",
            "enum": [
              "email",
              "mark"
            ]
          },
          "email_address": {
            "type": "string",
            "description": "E-mail address to send to (required when method = email).",
            "format": "email"
          }
        },
        "example": {
          "method": "email",
          "email_address": "facturen@voorbeeld.nl"
        }
      },
      "CreateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The ID of the created/updated resource."
          },
          "url": {
            "type": "string",
            "description": "Direct URL to the resource in the Informer web app."
          }
        },
        "example": {
          "id": 12345,
          "url": "https://app.informer.eu/sales-invoice/12345"
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number."
          },
          "records": {
            "type": "integer",
            "description": "Number of records per page."
          },
          "total": {
            "type": "integer",
            "description": "Total number of records."
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages."
          }
        },
        "example": {
          "page": 0,
          "records": 100,
          "total": 42,
          "pages": 1
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "description": "Error message(s).",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "response_code": {
            "type": "integer",
            "description": "HTTP status code."
          }
        },
        "example": {
          "error": [
            "Resource niet gevonden."
          ],
          "response_code": 404
        }
      },
      "Memorandum": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier."
          },
          "entry_number": {
            "type": "integer",
            "description": "Auto-generated entry number."
          },
          "journal_id": {
            "type": "integer",
            "description": "ID of the memorandum journal this entry belongs to."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Entry date (YYYY-mm-dd)."
          },
          "description": {
            "type": "string",
            "description": "Entry description."
          },
          "lines": {
            "type": "array",
            "description": "Journal entry lines.",
            "items": {
              "type": "object",
              "properties": {
                "ledger_id": {
                  "type": "integer",
                  "description": "Ledger account ID."
                },
                "costs_id": {
                  "type": "integer",
                  "description": "Cost centre ID.",
                  "nullable": true
                },
                "description": {
                  "type": "string",
                  "description": "Line description."
                },
                "debit": {
                  "type": "number",
                  "format": "float",
                  "description": "Debit amount."
                },
                "credit": {
                  "type": "number",
                  "format": "float",
                  "description": "Credit amount."
                }
              }
            }
          }
        },
        "example": {
          "id": 1,
          "entry_number": 1001,
          "journal_id": 5,
          "date": "2024-01-15",
          "description": "Correctieboeking januari",
          "lines": [
            {
              "ledger_id": 1300,
              "costs_id": null,
              "description": "Debiteuren",
              "debit": 121.0,
              "credit": 0.0
            },
            {
              "ledger_id": 8000,
              "costs_id": null,
              "description": "Omzet",
              "debit": 0.0,
              "credit": 121.0
            }
          ]
        }
      },
      "MemorandumInput": {
        "type": "object",
        "required": [
          "journal_id",
          "date",
          "description",
          "lines"
        ],
        "properties": {
          "journal_id": {
            "type": "integer",
            "description": "ID of the memorandum journal (type 4) to post to."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Entry date (format: YYYY-mm-dd). Must not fall within a locked period."
          },
          "description": {
            "type": "string",
            "description": "Entry description."
          },
          "lines": {
            "type": "array",
            "description": "Journal entry lines. The sum of all debit amounts must equal the sum of all credit amounts.",
            "items": {
              "$ref": "#/components/schemas/MemorandumLineInput"
            }
          }
        },
        "example": {
          "journal_id": 5,
          "date": "2024-01-15",
          "description": "Correctieboeking januari",
          "lines": [
            {
              "ledger_id": 1300,
              "costs_id": null,
              "description": "Debiteuren",
              "debit": 121.0,
              "credit": 0.0
            },
            {
              "ledger_id": 8000,
              "costs_id": null,
              "description": "Omzet",
              "debit": 0.0,
              "credit": 121.0
            }
          ]
        }
      },
      "MemorandumLineInput": {
        "type": "object",
        "required": [
          "ledger_id",
          "debit",
          "credit"
        ],
        "properties": {
          "ledger_id": {
            "type": "integer",
            "description": "Ledger account ID. Must be a valid ledger account in this administration."
          },
          "costs_id": {
            "type": "integer",
            "description": "Cost centre ID (optional). Must be a valid cost centre in this administration."
          },
          "description": {
            "type": "string",
            "description": "Line description."
          },
          "debit": {
            "type": "number",
            "format": "float",
            "description": "Debit amount. Use 0 if this line is a credit line."
          },
          "credit": {
            "type": "number",
            "format": "float",
            "description": "Credit amount. Use 0 if this line is a debit line."
          },
          "type": {
            "type": "string",
            "description": "Invoice type for linking this line to an existing invoice. Must be provided together with invoice_id — omit both to create a standalone line.",
            "enum": [
              "sales",
              "purchase",
              "receipt"
            ]
          },
          "invoice_id": {
            "type": "integer",
            "description": "ID of the invoice to link this line to. Must be provided together with type — omit both to create a standalone line. The linked invoice's paid amount will be updated automatically."
          }
        },
        "example": {
          "ledger_id": 1300,
          "costs_id": null,
          "description": "Debiteuren",
          "debit": 121.0,
          "credit": 0.0
        }
      },
      "BalanceReport": {
        "type": "object",
        "description": "Balance sheet report data. The structure is an associative object of report rows keyed by row index.",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "columns": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "style": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "example": {
          "0": {
            "columns": [
              {
                "text": "Activa",
                "style": {
                  "fontWeight": "bold"
                }
              },
              {
                "text": "500.000,00",
                "style": {}
              }
            ]
          },
          "1": {
            "columns": [
              {
                "text": "Debiteuren",
                "style": {}
              },
              {
                "text": "121.000,00",
                "style": {}
              }
            ]
          },
          "2": {
            "columns": [
              {
                "text": "Bank",
                "style": {}
              },
              {
                "text": "379.000,00",
                "style": {}
              }
            ]
          }
        }
      },
      "ColumnBalanceReport": {
        "type": "object",
        "description": "Column balance report data. The structure is an associative object of report rows keyed by row index.",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "columns": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "style": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "example": {
          "0": {
            "columns": [
              {
                "text": "Omzet hoog tarief",
                "style": {}
              },
              {
                "text": "50.000,00",
                "style": {}
              },
              {
                "text": "75.000,00",
                "style": {}
              }
            ]
          },
          "1": {
            "columns": [
              {
                "text": "Omzet laag tarief",
                "style": {}
              },
              {
                "text": "10.000,00",
                "style": {}
              },
              {
                "text": "12.000,00",
                "style": {}
              }
            ]
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "description": "Validation errors keyed by field name.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "response_code": {
            "type": "integer",
            "description": "HTTP status code (422).",
            "example": 422
          }
        },
        "example": {
          "error": {
            "relation_id": "relation_id is verplicht.",
            "invoice_date": "invoice_date moet een geldige datum zijn (Y-m-d)."
          },
          "response_code": 422
        }
      }
    },
    "securitySchemes": {
      "Apikey": {
        "type": "apiKey",
        "name": "Apikey",
        "in": "header",
        "description": "Your API key. Can be created at https://app.informer.eu/settings/api/",
        "value": "your-api-key"
      },
      "Code": {
        "type": "apiKey",
        "name": "Securitycode",
        "in": "header",
        "description": "The security code of the company. Can be found in your company settings at https://app.informer.eu/settings/account/",
        "value": "your-security-code"
      }
    }
  }
}
