{
    "openapi": "3.1.0",
    "info": {
        "title": "NONOX Connect API",
        "version": "1.1.0",
        "description": "The public API of NONOX Ekonomisystem, an open-source Swedish bookkeeping system.\n\n**Authentication.** Apps use OAuth 2.0 authorization code with PKCE (S256 is required for every client; implicit, password, client credentials and device grants do not exist). An owner or administrator approves the app on the Swedish consent screen with a passkey and chooses one company. Access tokens live at most 15 minutes; refresh tokens rotate on every use, and a refresh token (or authorization code) used twice revokes the whole grant. Scripts use API keys (`nnx_…`) created under Anslutningar: one company, chosen scopes, mandatory expiry, optional IP allowlist, shown once and stored hashed. Send either as `Authorization: Bearer …`; cookies are never accepted.\n\n**One company per credential.** Every token and key belongs to exactly one company. Another company's ids answer 404. While NONOX Connect is turned off for the company, every call answers 404. An archived company can only be read.\n\n**Effective rights.** A request may do what its scopes allow AND what the person who granted the app or created the key may do in the company right now, evaluated on every request. A changed role reduces access at once; a person who leaves the company takes the credential's access with them.\n\n**Rate limits.** Per credential 120 requests/minute, per company 600/minute, and 600/minute per IP address before authentication (operators can change these). Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; 429 adds Retry-After.\n\n**Idempotency.** Every POST requires an Idempotency-Key, kept 24 hours per credential.\n\n**Errors** are RFC 9457 `application/problem+json` with a stable `code` and a Swedish `detail`.\n\n**Money** is integer öre (1 SEK = 100 öre) in fields ending in `_ore`. Dates are ISO 8601.\n\n**Versioning.** The version is in the path (`/v1`). Within v1 changes are additive only (new endpoints, new optional fields, new enum values in responses); anything breaking gets `/v2`, with v1 kept alongside.\n\n**Webhooks** (described under `webhooks`) are set up under Anslutningar by an owner or administrator with a passkey: an https address on the internet, chosen events and a signing secret shown once. Deliveries carry `Nonox-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">` and `Nonox-Event-Id`, are sent after the change has committed, and are retried for about a day. Addresses that resolve to private, loopback, link-local, CGNAT or multicast networks are refused.\n\n**Booking routes.** Issuing an invoice, registering a supplier invoice and registering a payment post a voucher as the person behind the credential, so they need vouchers:create and vouchers:post as well (`x-required-scopes`).\n\n**Revocation.** An app revokes its own grant with `POST /oauth/revoke` (RFC 7009).\n\n**Test companies.** An operator (`php artisan connect:test-company <email>`) or an owner under Anslutningar can create a clearly marked test company with demo data to try the API against. It never e-mails documents.",
        "x-sv-description": "Det öppna API:t för NONOX Ekonomisystem. Appar ansluts med OAuth 2.0 (auktoriseringskod med PKCE S256) och godkänns av en ägare eller administratör med passkey; skript använder API-nycklar som skapas under Anslutningar. Varje nyckel eller app gäller ett företag och får aldrig mer än sina behörigheter och vad personen som gav den får göra just nu. Fel kommer som problem+json med svensk förklaring. Varje POST kräver Idempotency-Key. Belopp anges i öre. Webhooks signeras med HMAC-SHA256 och skickas efter att ändringen har sparats. Testföretag med exempeldata finns för att prova API:t.",
        "license": {
            "name": "AGPL-3.0-only",
            "identifier": "AGPL-3.0-only"
        },
        "contact": {
            "name": "NONOX",
            "url": "https://github.com/STAFE-GROUP-AB/nonox"
        }
    },
    "servers": [
        {
            "url": "https://nonox.app/api/v1",
            "description": "NONOX (hosted)"
        },
        {
            "url": "https://{host}/api/v1",
            "description": "A self-hosted NONOX",
            "variables": {
                "host": {
                    "default": "nonox.example.se",
                    "description": "Your installation's host name."
                }
            }
        }
    ],
    "tags": [
        {
            "name": "Företaget",
            "x-en-name": "Company",
            "description": "The company the credential belongs to.",
            "x-sv-description": "Företaget som nyckeln eller appen gäller."
        },
        {
            "name": "Bokföring",
            "x-en-name": "Bookkeeping",
            "description": "Reference data for bookkeeping: chart of accounts, VAT codes, fiscal years and voucher series.",
            "x-sv-description": "Kontoplan, momskoder, räkenskapsår och verifikationsserier."
        },
        {
            "name": "Verifikationer",
            "x-en-name": "Vouchers",
            "description": "Vouchers: drafts, posting, corrections and attachments (underlag). A posted voucher is immutable.",
            "x-sv-description": "Verifikationer: utkast, bokföring, rättelser och underlag. En bokförd verifikation kan aldrig ändras."
        },
        {
            "name": "Kunder",
            "x-en-name": "Customers",
            "description": "The customer register.",
            "x-sv-description": "Kundregistret."
        },
        {
            "name": "Leverantörer",
            "x-en-name": "Suppliers",
            "description": "The supplier register.",
            "x-sv-description": "Leverantörsregistret."
        },
        {
            "name": "Kostnadsställen och projekt",
            "x-en-name": "Cost centres and projects",
            "description": "Cost centres (SIE dimension 1) and projects (dimension 6).",
            "x-sv-description": "Kostnadsställen och projekt."
        },
        {
            "name": "Rapporter",
            "x-en-name": "Reports",
            "description": "Trial balance, general ledger, balance sheet and income statement as JSON.",
            "x-sv-description": "Saldobalans, huvudbok, balansrapport och resultatrapport."
        },
        {
            "name": "Moms",
            "x-en-name": "VAT",
            "description": "VAT periods and the VAT return per period (read-only).",
            "x-sv-description": "Momsperioder och momsdeklaration."
        },
        {
            "name": "Artiklar",
            "x-en-name": "Articles",
            "description": "The article register.",
            "x-sv-description": "Artikelregistret."
        },
        {
            "name": "Kundfakturor",
            "x-en-name": "Customer invoices",
            "description": "Customer invoices: drafts, issuing, e-mail, credit, payments and PDF. An issued invoice never changes.",
            "x-sv-description": "Kundfakturor: utkast, skapa, mejla, kreditera, betalningar och PDF."
        },
        {
            "name": "Leverantörsfakturor",
            "x-en-name": "Supplier invoices",
            "description": "Supplier invoices: drafts, file, registering, approval with segregation of duties and payment.",
            "x-sv-description": "Leverantörsfakturor: utkast, fil, registrering, attest och betalning."
        },
        {
            "name": "Betalningar",
            "x-en-name": "Payments",
            "description": "Incoming and outgoing payments, read-only.",
            "x-sv-description": "In- och utbetalningar."
        }
    ],
    "security": [
        {
            "oauth2": []
        },
        {
            "apiKey": []
        }
    ],
    "paths": {
        "/company": {
            "get": {
                "operationId": "getCompany",
                "tags": [
                    "Företaget"
                ],
                "summary": "Get the company",
                "description": "The company the credential is bound to, plus what the credential is (type, name, effective scopes on the credential). Needs no scope: every valid token or API key can read it. Use it to confirm which company a token belongs to.",
                "x-sv-summary": "Hämta företaget",
                "x-sv-description": "Företaget som nyckeln eller token är bunden till, och vilken nyckel eller app det är. Kräver ingen särskild behörighet.",
                "security": [
                    {
                        "oauth2": []
                    },
                    {
                        "apiKey": []
                    }
                ],
                "x-required-scopes": {
                    "anyOf": []
                },
                "responses": {
                    "200": {
                        "description": "The company.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CompanyWithCredential"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 42,
                                                "name": "Exempelbolaget AB",
                                                "legal_name": "Exempelbolaget AB",
                                                "org_number": "556677-1233",
                                                "legal_form": "AB",
                                                "vat_number": "SE556677123301",
                                                "vat_registered": true,
                                                "vat_period": "QUARTERLY",
                                                "accounting_method": "FAKTURAMETODEN",
                                                "reporting_framework": "K2",
                                                "fiscal_year_start_month": 1,
                                                "base_currency": "SEK",
                                                "locked_until_date": "2026-06-30",
                                                "archived": false,
                                                "address": {
                                                    "line1": "Exempelgatan 1",
                                                    "line2": null,
                                                    "postal_code": "111 22",
                                                    "city": "Exempelstad",
                                                    "country": "SE"
                                                },
                                                "credential": {
                                                    "type": "oauth",
                                                    "name": "Exempelappen",
                                                    "scopes": [
                                                        "vouchers:view",
                                                        "vouchers:create",
                                                        "vouchers:post"
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/accounts": {
            "get": {
                "operationId": "listAccounts",
                "tags": [
                    "Bokföring"
                ],
                "summary": "List the chart of accounts",
                "description": "The company's accounts (BAS numbering, 1000–9999), ordered by updated_at then number's row id. Filter on is_active. Supports updated_since for sync.",
                "x-sv-summary": "Lista kontoplanen",
                "x-sv-description": "Företagets konton enligt BAS. Kan filtreras på aktiva konton och synkas med updated_since.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of accounts.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Account"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "number": 1930,
                                                    "name": "Företagskonto",
                                                    "type": "ASSET",
                                                    "is_active": true,
                                                    "sru_code": "7281",
                                                    "requires_cost_center": false,
                                                    "requires_project": false,
                                                    "updated_at": "2026-01-02T09:15:00+01:00"
                                                },
                                                {
                                                    "number": 3001,
                                                    "name": "Försäljning varor 25 % moms",
                                                    "type": "REVENUE",
                                                    "is_active": true,
                                                    "sru_code": "7410",
                                                    "requires_cost_center": false,
                                                    "requires_project": false,
                                                    "updated_at": "2026-01-02T09:15:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": "eyJ1cGRhdGVkX2F0IjoiMjAyNi0wMy0wMiAxMDo0NToxMiIsImlkIjoiMGI5ZjNjMWUiLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
                                                "has_more": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/accounts/{number}": {
            "get": {
                "operationId": "getAccount",
                "tags": [
                    "Bokföring"
                ],
                "summary": "Get an account",
                "description": "One account by its account number.",
                "x-sv-summary": "Hämta ett konto",
                "x-sv-description": "Ett konto, utifrån kontonumret.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "Account number, 1000–9999.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1000,
                            "maximum": 9999
                        },
                        "example": 1930
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The account.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Account"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "number": 1930,
                                                "name": "Företagskonto",
                                                "type": "ASSET",
                                                "is_active": true,
                                                "sru_code": "7281",
                                                "requires_cost_center": false,
                                                "requires_project": false,
                                                "updated_at": "2026-01-02T09:15:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vat-codes": {
            "get": {
                "operationId": "listVatCodes",
                "tags": [
                    "Bokföring"
                ],
                "summary": "List VAT codes",
                "description": "NONOX keeps VAT by account, not by a code table: a sale at 25 % books its VAT on 2611, which the VAT return reads into box 10. This list is derived from the same constants invoicing, supplier invoices and the VAT return use. Not paginated.",
                "x-sv-summary": "Lista momskoder",
                "x-sv-description": "NONOX håller moms per konto. Listan bygger på samma konton och rutor som fakturering och momsdeklarationen använder. Inte sidindelad.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "All VAT codes.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/VatCode"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "code": "SALE_SE_25",
                                                    "name": "Försäljning i Sverige, 25 % moms",
                                                    "type": "SALE_SE",
                                                    "rate_basis_points": 2500,
                                                    "vat_account": 2611,
                                                    "report_box": 10
                                                },
                                                {
                                                    "code": "SALE_SE_12",
                                                    "name": "Försäljning i Sverige, 12 % moms",
                                                    "type": "SALE_SE",
                                                    "rate_basis_points": 1200,
                                                    "vat_account": 2621,
                                                    "report_box": 11
                                                },
                                                {
                                                    "code": "SALE_SE_6",
                                                    "name": "Försäljning i Sverige, 6 % moms",
                                                    "type": "SALE_SE",
                                                    "rate_basis_points": 600,
                                                    "vat_account": 2631,
                                                    "report_box": 12
                                                },
                                                {
                                                    "code": "PURCHASE_SE",
                                                    "name": "Inköp i Sverige, avdragsgill ingående moms",
                                                    "type": "PURCHASE_SE",
                                                    "rate_basis_points": null,
                                                    "vat_account": 2641,
                                                    "report_box": 48
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/fiscal-years": {
            "get": {
                "operationId": "listFiscalYears",
                "tags": [
                    "Bokföring"
                ],
                "summary": "List fiscal years",
                "description": "The company's fiscal years (räkenskapsår), open and closed.",
                "x-sv-summary": "Lista räkenskapsår",
                "x-sv-description": "Företagets räkenskapsår, öppna och stängda.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of fiscal years.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/FiscalYear"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 7,
                                                    "start_date": "2026-01-01",
                                                    "end_date": "2026-12-31",
                                                    "status": "OPEN",
                                                    "updated_at": "2026-01-02T09:15:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/fiscal-years/{fiscalYear}": {
            "get": {
                "operationId": "getFiscalYear",
                "tags": [
                    "Bokföring"
                ],
                "summary": "Get a fiscal year",
                "description": "One fiscal year by id.",
                "x-sv-summary": "Hämta ett räkenskapsår",
                "x-sv-description": "Ett räkenskapsår, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscalYear",
                        "in": "path",
                        "required": true,
                        "description": "Fiscal year id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 7
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The fiscal year.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/FiscalYear"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 7,
                                                "start_date": "2026-01-01",
                                                "end_date": "2026-12-31",
                                                "status": "OPEN",
                                                "updated_at": "2026-01-02T09:15:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/fiscal-years/{fiscalYear}/periods": {
            "parameters": [
                {
                    "name": "fiscalYear",
                    "in": "path",
                    "required": true,
                    "description": "Fiscal year id.",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 7
                }
            ],
            "get": {
                "operationId": "listFiscalYearPeriods",
                "tags": [
                    "Bokföring"
                ],
                "summary": "List the months of a fiscal year and their lock status",
                "description": "The fiscal year's months and whether each is locked by the company's lock date (nothing can be posted on or before locked_until_date).",
                "x-sv-summary": "Räkenskapsårets perioder och låsning",
                "x-sv-description": "Räkenskapsårets månader och om de är låsta för bokföring.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The periods.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/FiscalYearPeriods"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "status": "OPEN",
                                                "locked_until_date": "2026-03-15",
                                                "periods": [
                                                    {
                                                        "start": "2026-02-01",
                                                        "end": "2026-02-28",
                                                        "locked": true,
                                                        "partly_locked": false
                                                    },
                                                    {
                                                        "start": "2026-03-01",
                                                        "end": "2026-03-31",
                                                        "locked": false,
                                                        "partly_locked": true
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/fiscal-years/{fiscalYear}/sie": {
            "parameters": [
                {
                    "name": "fiscalYear",
                    "in": "path",
                    "required": true,
                    "description": "Fiscal year id.",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 7
                }
            ],
            "get": {
                "operationId": "exportSie",
                "tags": [
                    "Bokföring"
                ],
                "summary": "Export a fiscal year as SIE 4",
                "description": "The fiscal year as a SIE 4 file (SIE 4E): identification, chart of accounts, opening and closing balances, results and every posted voucher, encoded in CP437 (IBM437) with #KSUMMA. The same export as the app (ExportSie). Drafts are not included.",
                "x-sv-summary": "Hämta räkenskapsåret som SIE-fil",
                "x-sv-description": "Räkenskapsåret som SIE 4-fil i teckenkodningen CP437, med alla bokförda verifikationer.",
                "security": [
                    {
                        "oauth2": [
                            "export:sie"
                        ]
                    },
                    {
                        "apiKey": [
                            "export:sie"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "export:sie"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The SIE file (Content-Disposition: attachment).",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "text/plain; charset=IBM437": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/cost-centers": {
            "get": {
                "operationId": "listCostCenters",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "List cost centres",
                "description": "The company's cost centres (SIE dimension 1).",
                "x-sv-summary": "Lista kostnadsställen",
                "x-sv-description": "Företagets kostnadsställen.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of cost centres.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DimensionObject"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 4,
                                                    "code": "10",
                                                    "name": "Butiken",
                                                    "is_active": true,
                                                    "created_at": "2026-03-02T10:45:12+01:00",
                                                    "updated_at": "2026-03-02T10:45:12+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createCostCenter",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Create a cost centre",
                "description": "Adds a cost centre. The code never changes afterwards. Same Action as the app (SaveDimensionObject).",
                "x-sv-summary": "Lägg till kostnadsställe",
                "x-sv-description": "Lägger till ett kostnadsställe. Koden kan inte ändras efteråt.",
                "security": [
                    {
                        "oauth2": [
                            "accounts:manage"
                        ]
                    },
                    {
                        "apiKey": [
                            "accounts:manage"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "accounts:manage"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DimensionInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "code": "10",
                                        "name": "Butiken"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The cost centre.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/cost-centers/{costCenter}": {
            "parameters": [
                {
                    "name": "costCenter",
                    "in": "path",
                    "required": true,
                    "description": "Cost centre id (not the code).",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 4
                }
            ],
            "get": {
                "operationId": "getCostCenter",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Get a cost centre",
                "description": "One cost centre by id.",
                "x-sv-summary": "Hämta kostnadsställe",
                "x-sv-description": "Ett kostnadsställe, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The cost centre.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateCostCenter",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Rename or deactivate a cost centre",
                "description": "Changes the name or is_active; the code cannot change.",
                "x-sv-summary": "Ändra kostnadsställe",
                "x-sv-description": "Byter namn eller aktiverar och inaktiverar. Koden ändras aldrig.",
                "security": [
                    {
                        "oauth2": [
                            "accounts:manage"
                        ]
                    },
                    {
                        "apiKey": [
                            "accounts:manage"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "accounts:manage"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DimensionPatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "name": "Butiken i Exempelstad"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The cost centre.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/projects": {
            "get": {
                "operationId": "listProjects",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "List projects",
                "description": "The company's projects (SIE dimension 6).",
                "x-sv-summary": "Lista projekt",
                "x-sv-description": "Företagets projekt.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of projects.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DimensionObject"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 4,
                                                    "code": "10",
                                                    "name": "Butiken",
                                                    "is_active": true,
                                                    "created_at": "2026-03-02T10:45:12+01:00",
                                                    "updated_at": "2026-03-02T10:45:12+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createProject",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Create a project",
                "description": "Adds a project. The code never changes afterwards. Same Action as the app (SaveDimensionObject).",
                "x-sv-summary": "Lägg till projekt",
                "x-sv-description": "Lägger till ett projekt. Koden kan inte ändras efteråt.",
                "security": [
                    {
                        "oauth2": [
                            "accounts:manage"
                        ]
                    },
                    {
                        "apiKey": [
                            "accounts:manage"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "accounts:manage"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DimensionInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "code": "10",
                                        "name": "Butiken"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The project.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/projects/{project}": {
            "parameters": [
                {
                    "name": "project",
                    "in": "path",
                    "required": true,
                    "description": "Project id (not the code).",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 4
                }
            ],
            "get": {
                "operationId": "getProject",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Get a project",
                "description": "One project by id.",
                "x-sv-summary": "Hämta projekt",
                "x-sv-description": "Ett projekt, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The project.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateProject",
                "tags": [
                    "Kostnadsställen och projekt"
                ],
                "summary": "Rename or deactivate a project",
                "description": "Changes the name or is_active; the code cannot change.",
                "x-sv-summary": "Ändra projekt",
                "x-sv-description": "Byter namn eller aktiverar och inaktiverar. Koden ändras aldrig.",
                "security": [
                    {
                        "oauth2": [
                            "accounts:manage"
                        ]
                    },
                    {
                        "apiKey": [
                            "accounts:manage"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "accounts:manage"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DimensionPatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "name": "Butiken i Exempelstad"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The project.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DimensionObject"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 4,
                                                "code": "10",
                                                "name": "Butiken",
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/voucher-series": {
            "get": {
                "operationId": "listVoucherSeries",
                "tags": [
                    "Bokföring"
                ],
                "summary": "List voucher series",
                "description": "The voucher series (A Manuell, B Kundfakturor, …). Numbers are gapless per series and fiscal year. Not paginated.",
                "x-sv-summary": "Lista verifikationsserier",
                "x-sv-description": "Verifikationsserierna. Numren är obrutna per serie och räkenskapsår. Inte sidindelad.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "All series.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/VoucherSeries"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "code": "A",
                                                    "name": "Manuell",
                                                    "is_default": true
                                                },
                                                {
                                                    "code": "B",
                                                    "name": "Kundfakturor",
                                                    "is_default": false
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers": {
            "get": {
                "operationId": "listVouchers",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "List vouchers",
                "description": "Vouchers with their rows and attachment metadata, filtered by status, series, fiscal year and voucher date. Use updated_since to sync: posting a draft changes its updated_at, a posted voucher never changes again except that corrected_by_voucher_id is set once when it is corrected.",
                "x-sv-summary": "Lista verifikationer",
                "x-sv-description": "Verifikationer med rader och underlag. Filtrera på status, serie, räkenskapsår och datum. Synka med updated_since.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "DRAFT or POSTED.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "DRAFT",
                                "POSTED"
                            ]
                        }
                    },
                    {
                        "name": "series",
                        "in": "query",
                        "required": false,
                        "description": "Series code, for example A.",
                        "schema": {
                            "type": "string",
                            "maxLength": 3
                        }
                    },
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": false,
                        "description": "Only vouchers in this fiscal year.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Voucher date on or after (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Voucher date on or before (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of vouchers.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Voucher"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                    "series": "A",
                                                    "number": 57,
                                                    "reference": "A57",
                                                    "status": "POSTED",
                                                    "fiscal_year_id": 7,
                                                    "voucher_date": "2026-03-02",
                                                    "description": "Kontantförsäljning",
                                                    "source": "MANUAL",
                                                    "corrects_voucher_id": null,
                                                    "corrected_by_voucher_id": null,
                                                    "posted_at": "2026-03-02T10:45:12+01:00",
                                                    "hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
                                                    "currency": "SEK",
                                                    "rows": [
                                                        {
                                                            "account": 1930,
                                                            "debit_ore": 125000,
                                                            "credit_ore": 0,
                                                            "description": null,
                                                            "cost_center": null,
                                                            "project": null
                                                        },
                                                        {
                                                            "account": 3001,
                                                            "debit_ore": 0,
                                                            "credit_ore": 100000,
                                                            "description": null,
                                                            "cost_center": null,
                                                            "project": null
                                                        },
                                                        {
                                                            "account": 2611,
                                                            "debit_ore": 0,
                                                            "credit_ore": 25000,
                                                            "description": null,
                                                            "cost_center": null,
                                                            "project": null
                                                        }
                                                    ],
                                                    "attachments": [
                                                        {
                                                            "id": 311,
                                                            "name": "kvitto-kontorsmaterial.pdf",
                                                            "mime": "application/pdf",
                                                            "size": 48213,
                                                            "sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
                                                            "created_at": "2026-03-02T10:41:07+01:00"
                                                        }
                                                    ],
                                                    "created_at": "2026-03-02T10:40:00+01:00",
                                                    "updated_at": "2026-03-02T10:45:12+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": "eyJ1cGRhdGVkX2F0IjoiMjAyNi0wMy0wMiAxMDo0NToxMiIsImlkIjoiMGI5ZjNjMWUiLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
                                                "has_more": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createVoucher",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Create a voucher draft",
                "description": "Creates a draft (status DRAFT, no number). Rows are validated as in the app: known active accounts, cost center/project when the account requires one, a row has either debit or credit. The fiscal year is chosen from voucher_date. Balance is checked when posting. Same Action as the app (SaveDraftVoucher).",
                "x-sv-summary": "Skapa ett utkast",
                "x-sv-description": "Skapar ett utkast till verifikation (utan nummer). Raderna kontrolleras som i appen. Balansen kontrolleras när utkastet bokförs.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "description": "The voucher. Amounts in öre (1 krona = 100 öre).",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/VoucherInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "voucher_date": "2026-03-02",
                                        "description": "Kontantförsäljning",
                                        "series": "A",
                                        "rows": [
                                            {
                                                "account": 1930,
                                                "debit_ore": 125000
                                            },
                                            {
                                                "account": 3001,
                                                "credit_ore": 100000
                                            },
                                            {
                                                "account": 2611,
                                                "credit_ore": 25000
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Voucher"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                "series": "A",
                                                "number": null,
                                                "reference": null,
                                                "status": "DRAFT",
                                                "fiscal_year_id": 7,
                                                "voucher_date": "2026-03-02",
                                                "description": "Kontantförsäljning",
                                                "source": "MANUAL",
                                                "corrects_voucher_id": null,
                                                "corrected_by_voucher_id": null,
                                                "posted_at": null,
                                                "hash": null,
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "debit_ore": 125000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "debit_ore": 0,
                                                        "credit_ore": 100000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 2611,
                                                        "debit_ore": 0,
                                                        "credit_ore": 25000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    }
                                                ],
                                                "attachments": [],
                                                "created_at": "2026-03-02T10:40:00+01:00",
                                                "updated_at": "2026-03-02T10:40:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers/{voucher}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VoucherId"
                }
            ],
            "get": {
                "operationId": "getVoucher",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Get a voucher",
                "description": "One voucher with rows and attachment metadata.",
                "x-sv-summary": "Hämta en verifikation",
                "x-sv-description": "En verifikation med rader och underlag.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The voucher.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Voucher"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                "series": "A",
                                                "number": 57,
                                                "reference": "A57",
                                                "status": "POSTED",
                                                "fiscal_year_id": 7,
                                                "voucher_date": "2026-03-02",
                                                "description": "Kontantförsäljning",
                                                "source": "MANUAL",
                                                "corrects_voucher_id": null,
                                                "corrected_by_voucher_id": null,
                                                "posted_at": "2026-03-02T10:45:12+01:00",
                                                "hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "debit_ore": 125000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "debit_ore": 0,
                                                        "credit_ore": 100000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 2611,
                                                        "debit_ore": 0,
                                                        "credit_ore": 25000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    }
                                                ],
                                                "attachments": [
                                                    {
                                                        "id": 311,
                                                        "name": "kvitto-kontorsmaterial.pdf",
                                                        "mime": "application/pdf",
                                                        "size": 48213,
                                                        "sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
                                                        "created_at": "2026-03-02T10:41:07+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:40:00+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateVoucherDraft",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Change a voucher draft",
                "description": "Changes a draft. Fields left out keep their values; `rows`, when sent, replaces all rows. A posted voucher can never be changed: the answer is 403 (correct it instead).",
                "x-sv-summary": "Ändra ett utkast",
                "x-sv-description": "Ändrar ett utkast. Fält som utelämnas behåller sina värden; rows ersätter alla rader. En bokförd verifikation kan aldrig ändras (403); rätta den i stället.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/VoucherPatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "description": "Kontantförsäljning, kassa 2"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The changed draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Voucher"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                "series": "A",
                                                "number": null,
                                                "reference": null,
                                                "status": "DRAFT",
                                                "fiscal_year_id": 7,
                                                "voucher_date": "2026-03-02",
                                                "description": "Kontantförsäljning, kassa 2",
                                                "source": "MANUAL",
                                                "corrects_voucher_id": null,
                                                "corrected_by_voucher_id": null,
                                                "posted_at": null,
                                                "hash": null,
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "debit_ore": 125000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "debit_ore": 0,
                                                        "credit_ore": 100000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 2611,
                                                        "debit_ore": 0,
                                                        "credit_ore": 25000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    }
                                                ],
                                                "attachments": [],
                                                "created_at": "2026-03-02T10:40:00+01:00",
                                                "updated_at": "2026-03-02T10:40:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "delete": {
                "operationId": "deleteVoucherDraft",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Delete a voucher draft",
                "description": "Deletes a draft. A posted voucher can never be deleted (403).",
                "x-sv-summary": "Ta bort ett utkast",
                "x-sv-description": "Tar bort ett utkast. En bokförd verifikation kan aldrig tas bort (403).",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:create"
                        ]
                    ]
                },
                "responses": {
                    "204": {
                        "description": "Deleted.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers/{voucher}/post": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VoucherId"
                }
            ],
            "post": {
                "operationId": "postVoucher",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Post a voucher",
                "description": "Posts a draft (bokför): checks that it balances, that the date is in an open fiscal year and not in a locked period, assigns the next gapless number in its series and fiscal year, extends the hash chain and writes the audit log. Irreversible: a posted voucher is only ever corrected. Same Action as the app (PostVoucher). No body.",
                "x-sv-summary": "Bokför en verifikation",
                "x-sv-description": "Bokför ett utkast: kontrollerar balans, räkenskapsår och låsta perioder, ger nästa nummer i serien utan luckor och skriver behandlingshistorik. Går inte att ångra, bara rätta.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:post"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:post"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:post"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The posted voucher.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Voucher"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                "series": "A",
                                                "number": 57,
                                                "reference": "A57",
                                                "status": "POSTED",
                                                "fiscal_year_id": 7,
                                                "voucher_date": "2026-03-02",
                                                "description": "Kontantförsäljning",
                                                "source": "MANUAL",
                                                "corrects_voucher_id": null,
                                                "corrected_by_voucher_id": null,
                                                "posted_at": "2026-03-02T10:45:12+01:00",
                                                "hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "debit_ore": 125000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "debit_ore": 0,
                                                        "credit_ore": 100000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 2611,
                                                        "debit_ore": 0,
                                                        "credit_ore": 25000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    }
                                                ],
                                                "attachments": [],
                                                "created_at": "2026-03-02T10:40:00+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers/{voucher}/correct": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VoucherId"
                }
            ],
            "post": {
                "operationId": "correctVoucher",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Correct a posted voucher",
                "description": "Creates and posts a correcting voucher (rättelseverifikation) that reverses the original and, if `rows` are given, books those instead. Both vouchers are linked. A voucher can be corrected once. Same Action as the app (CorrectVoucher).",
                "x-sv-summary": "Rätta en bokförd verifikation",
                "x-sv-description": "Skapar och bokför en rättelseverifikation som vänder originalet och, om rows skickas, bokför dem i stället. Båda länkas till varandra. En verifikation kan rättas en gång.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:correct"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:correct"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:correct"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "description": "Why, when, and optionally the rows to book instead.",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CorrectionInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "reason": "Fel konto",
                                        "date": "2026-03-05"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The correcting voucher.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Voucher"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "4e8d2c1b-7f6a-4b3c-8d9e-0a1b2c3d4e5f",
                                                "series": "A",
                                                "number": 58,
                                                "reference": "A58",
                                                "status": "POSTED",
                                                "fiscal_year_id": 7,
                                                "voucher_date": "2026-03-02",
                                                "description": "Rättelse av A57: fel konto",
                                                "source": "CORRECTION",
                                                "corrects_voucher_id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                "corrected_by_voucher_id": null,
                                                "posted_at": "2026-03-05T08:02:44+01:00",
                                                "hash": "8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b",
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "debit_ore": 0,
                                                        "credit_ore": 125000,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "debit_ore": 100000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    },
                                                    {
                                                        "account": 2611,
                                                        "debit_ore": 25000,
                                                        "credit_ore": 0,
                                                        "description": null,
                                                        "cost_center": null,
                                                        "project": null
                                                    }
                                                ],
                                                "attachments": [],
                                                "created_at": "2026-03-05T08:02:44+01:00",
                                                "updated_at": "2026-03-05T08:02:44+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers/{voucher}/attachments": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VoucherId"
                }
            ],
            "get": {
                "operationId": "listVoucherAttachments",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "List a voucher's attachments",
                "description": "Metadata of the voucher's underlag (not paginated).",
                "x-sv-summary": "Lista underlag",
                "x-sv-description": "Underlagen till en verifikation (inte sidindelad).",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The attachments.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Attachment"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 311,
                                                    "name": "kvitto-kontorsmaterial.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48213,
                                                    "sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
                                                    "created_at": "2026-03-02T10:41:07+01:00"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "addVoucherAttachment",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Add an attachment",
                "description": "Uploads underlag as multipart/form-data in the field `file`: a PDF or an image (JPG, PNG, WebP), at most 10 MB; the type is detected from the content, not the name. Allowed on drafts and on posted vouchers; an attachment is never removed from a posted voucher.",
                "x-sv-summary": "Lägg till underlag",
                "x-sv-description": "Laddar upp underlag som multipart/form-data i fältet file: PDF eller bild (JPG, PNG, WebP), högst 10 MB. Går på utkast och bokförda verifikationer; underlag tas aldrig bort från en bokförd verifikation.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "PDF, JPG, PNG or WebP, max 10 MB."
                                    }
                                }
                            },
                            "encoding": {
                                "file": {
                                    "contentType": "application/pdf, image/jpeg, image/png, image/webp"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The attachment.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Attachment"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 311,
                                                "name": "kvitto-kontorsmaterial.pdf",
                                                "mime": "application/pdf",
                                                "size": 48213,
                                                "sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
                                                "created_at": "2026-03-02T10:41:07+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vouchers/{voucher}/attachments/{attachment}/content": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VoucherId"
                }
            ],
            "get": {
                "operationId": "downloadVoucherAttachment",
                "tags": [
                    "Verifikationer"
                ],
                "summary": "Download an attachment",
                "description": "The file itself, as stored. X-Content-SHA256 lets you verify it against the sha256 in the metadata.",
                "x-sv-summary": "Hämta underlagets fil",
                "x-sv-description": "Själva filen. X-Content-SHA256 låter dig kontrollera den mot sha256 i metadata.",
                "security": [
                    {
                        "oauth2": [
                            "vouchers:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "vouchers:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vouchers:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "attachment",
                        "in": "path",
                        "required": true,
                        "description": "Attachment id.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 311
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "X-Content-SHA256": {
                                "$ref": "#/components/headers/ContentSha256"
                            },
                            "Content-Disposition": {
                                "description": "attachment; filename=\"…\"",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/webp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/customers": {
            "get": {
                "operationId": "listCustomers",
                "tags": [
                    "Kunder"
                ],
                "summary": "List customers",
                "description": "The customer register. Personal numbers are never returned, only has_personal_number.",
                "x-sv-summary": "Lista kunder",
                "x-sv-description": "Kundregistret. Personnummer lämnas aldrig ut, bara has_personal_number.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of customers.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Customer"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 18,
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "has_personal_number": false,
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "phone": "08-000 00 00",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    },
                                                    "payment_terms_days": 30,
                                                    "is_active": true,
                                                    "reverse_charge_construction": false,
                                                    "foreign_sale": null,
                                                    "processing_restricted": false,
                                                    "created_at": "2026-02-10T13:00:00+01:00",
                                                    "updated_at": "2026-02-10T13:00:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": "eyJ1cGRhdGVkX2F0IjoiMjAyNi0wMy0wMiAxMDo0NToxMiIsImlkIjoiMGI5ZjNjMWUiLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
                                                "has_more": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createCustomer",
                "tags": [
                    "Kunder"
                ],
                "summary": "Create a customer",
                "description": "Adds a customer; the number comes from the company's customer number series. personal_number is write-only (for sole traders and private persons) and is stored encrypted. Same Action as the app (SaveCustomer).",
                "x-sv-summary": "Lägg till en kund",
                "x-sv-description": "Lägger till en kund; numret tas ur företagets nummerserie. personal_number kan skrivas men läses aldrig ut.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "description": "The customer.",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CustomerInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "name": "Kund Exempel AB",
                                        "org_number": "559900-4560",
                                        "vat_number": "SE559900456001",
                                        "email": "faktura@kund.example.se",
                                        "address_line1": "Kundvägen 5",
                                        "postal_code": "222 33",
                                        "city": "Exempelby",
                                        "country": "SE",
                                        "payment_terms_days": 30
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The customer.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 18,
                                                "number": 1004,
                                                "name": "Kund Exempel AB",
                                                "org_number": "559900-4560",
                                                "has_personal_number": false,
                                                "vat_number": "SE559900456001",
                                                "email": "faktura@kund.example.se",
                                                "phone": "08-000 00 00",
                                                "address": {
                                                    "line1": "Kundvägen 5",
                                                    "line2": null,
                                                    "postal_code": "222 33",
                                                    "city": "Exempelby",
                                                    "country": "SE"
                                                },
                                                "payment_terms_days": 30,
                                                "is_active": true,
                                                "reverse_charge_construction": false,
                                                "foreign_sale": null,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-10T13:00:00+01:00",
                                                "updated_at": "2026-02-10T13:00:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/customers/{customer}": {
            "parameters": [
                {
                    "name": "customer",
                    "in": "path",
                    "required": true,
                    "description": "Customer id (not the customer number).",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 18
                }
            ],
            "get": {
                "operationId": "getCustomer",
                "tags": [
                    "Kunder"
                ],
                "summary": "Get a customer",
                "description": "One customer by id.",
                "x-sv-summary": "Hämta en kund",
                "x-sv-description": "En kund, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The customer.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 18,
                                                "number": 1004,
                                                "name": "Kund Exempel AB",
                                                "org_number": "559900-4560",
                                                "has_personal_number": false,
                                                "vat_number": "SE559900456001",
                                                "email": "faktura@kund.example.se",
                                                "phone": "08-000 00 00",
                                                "address": {
                                                    "line1": "Kundvägen 5",
                                                    "line2": null,
                                                    "postal_code": "222 33",
                                                    "city": "Exempelby",
                                                    "country": "SE"
                                                },
                                                "payment_terms_days": 30,
                                                "is_active": true,
                                                "reverse_charge_construction": false,
                                                "foreign_sale": null,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-10T13:00:00+01:00",
                                                "updated_at": "2026-02-10T13:00:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateCustomer",
                "tags": [
                    "Kunder"
                ],
                "summary": "Change a customer",
                "description": "Changes the fields sent; the others keep their values.",
                "x-sv-summary": "Ändra en kund",
                "x-sv-description": "Ändrar de fält som skickas; övriga behåller sina värden.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CustomerPatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "payment_terms_days": 20
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The customer.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 18,
                                                "number": 1004,
                                                "name": "Kund Exempel AB",
                                                "org_number": "559900-4560",
                                                "has_personal_number": false,
                                                "vat_number": "SE559900456001",
                                                "email": "faktura@kund.example.se",
                                                "phone": "08-000 00 00",
                                                "address": {
                                                    "line1": "Kundvägen 5",
                                                    "line2": null,
                                                    "postal_code": "222 33",
                                                    "city": "Exempelby",
                                                    "country": "SE"
                                                },
                                                "payment_terms_days": 20,
                                                "is_active": true,
                                                "reverse_charge_construction": false,
                                                "foreign_sale": null,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-10T13:00:00+01:00",
                                                "updated_at": "2026-02-10T13:00:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/suppliers": {
            "get": {
                "operationId": "listSuppliers",
                "tags": [
                    "Leverantörer"
                ],
                "summary": "List suppliers",
                "description": "The supplier register. Needs supplier-invoices:create or supplier-invoices:approve.",
                "x-sv-summary": "Lista leverantörer",
                "x-sv-description": "Leverantörsregistret.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ],
                        [
                            "supplier-invoices:approve"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of suppliers.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Supplier"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 9,
                                                    "number": 2001,
                                                    "name": "Leverantör Exempel AB",
                                                    "org_number": "559911-2223",
                                                    "vat_number": "SE559911222301",
                                                    "email": "reskontra@leverantor.example.se",
                                                    "phone": "031-000 00 00",
                                                    "address": {
                                                        "line1": "Leverantörsgatan 9",
                                                        "postal_code": "411 00",
                                                        "city": "Exempelhamn",
                                                        "country": "SE"
                                                    },
                                                    "bankgiro": "5550-1233",
                                                    "plusgiro": null,
                                                    "iban": null,
                                                    "bic": null,
                                                    "payment_terms_days": 30,
                                                    "default_account": 4010,
                                                    "is_active": true,
                                                    "processing_restricted": false,
                                                    "created_at": "2026-02-11T08:30:00+01:00",
                                                    "updated_at": "2026-02-11T08:30:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": "eyJ1cGRhdGVkX2F0IjoiMjAyNi0wMy0wMiAxMDo0NToxMiIsImlkIjoiMGI5ZjNjMWUiLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
                                                "has_more": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createSupplier",
                "tags": [
                    "Leverantörer"
                ],
                "summary": "Create a supplier",
                "description": "Adds a supplier; bankgiro and plusgiro are checked with their check digits. Same Action as the app (SaveSupplier).",
                "x-sv-summary": "Lägg till en leverantör",
                "x-sv-description": "Lägger till en leverantör; bankgiro och plusgiro kontrolleras med kontrollsiffran.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "description": "The supplier.",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SupplierInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "name": "Leverantör Exempel AB",
                                        "org_number": "559911-2223",
                                        "vat_number": "SE559911222301",
                                        "email": "reskontra@leverantor.example.se",
                                        "address_line1": "Leverantörsgatan 9",
                                        "postal_code": "411 00",
                                        "city": "Exempelhamn",
                                        "country": "SE",
                                        "bankgiro": "5550-1233",
                                        "payment_terms_days": 30,
                                        "default_account": 4010
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The supplier.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Supplier"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 9,
                                                "number": 2001,
                                                "name": "Leverantör Exempel AB",
                                                "org_number": "559911-2223",
                                                "vat_number": "SE559911222301",
                                                "email": "reskontra@leverantor.example.se",
                                                "phone": "031-000 00 00",
                                                "address": {
                                                    "line1": "Leverantörsgatan 9",
                                                    "postal_code": "411 00",
                                                    "city": "Exempelhamn",
                                                    "country": "SE"
                                                },
                                                "bankgiro": "5550-1233",
                                                "plusgiro": null,
                                                "iban": null,
                                                "bic": null,
                                                "payment_terms_days": 30,
                                                "default_account": 4010,
                                                "is_active": true,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-11T08:30:00+01:00",
                                                "updated_at": "2026-02-11T08:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/suppliers/{supplier}": {
            "parameters": [
                {
                    "name": "supplier",
                    "in": "path",
                    "required": true,
                    "description": "Supplier id (not the supplier number).",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 9
                }
            ],
            "get": {
                "operationId": "getSupplier",
                "tags": [
                    "Leverantörer"
                ],
                "summary": "Get a supplier",
                "description": "One supplier by id.",
                "x-sv-summary": "Hämta en leverantör",
                "x-sv-description": "En leverantör, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ],
                        [
                            "supplier-invoices:approve"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The supplier.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Supplier"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 9,
                                                "number": 2001,
                                                "name": "Leverantör Exempel AB",
                                                "org_number": "559911-2223",
                                                "vat_number": "SE559911222301",
                                                "email": "reskontra@leverantor.example.se",
                                                "phone": "031-000 00 00",
                                                "address": {
                                                    "line1": "Leverantörsgatan 9",
                                                    "postal_code": "411 00",
                                                    "city": "Exempelhamn",
                                                    "country": "SE"
                                                },
                                                "bankgiro": "5550-1233",
                                                "plusgiro": null,
                                                "iban": null,
                                                "bic": null,
                                                "payment_terms_days": 30,
                                                "default_account": 4010,
                                                "is_active": true,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-11T08:30:00+01:00",
                                                "updated_at": "2026-02-11T08:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateSupplier",
                "tags": [
                    "Leverantörer"
                ],
                "summary": "Change a supplier",
                "description": "Changes the fields sent; the others keep their values.",
                "x-sv-summary": "Ändra en leverantör",
                "x-sv-description": "Ändrar de fält som skickas; övriga behåller sina värden.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SupplierPatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "payment_terms_days": 10
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The supplier.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Supplier"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 9,
                                                "number": 2001,
                                                "name": "Leverantör Exempel AB",
                                                "org_number": "559911-2223",
                                                "vat_number": "SE559911222301",
                                                "email": "reskontra@leverantor.example.se",
                                                "phone": "031-000 00 00",
                                                "address": {
                                                    "line1": "Leverantörsgatan 9",
                                                    "postal_code": "411 00",
                                                    "city": "Exempelhamn",
                                                    "country": "SE"
                                                },
                                                "bankgiro": "5550-1233",
                                                "plusgiro": null,
                                                "iban": null,
                                                "bic": null,
                                                "payment_terms_days": 10,
                                                "default_account": 4010,
                                                "is_active": true,
                                                "processing_restricted": false,
                                                "created_at": "2026-02-11T08:30:00+01:00",
                                                "updated_at": "2026-02-11T08:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/reports/trial-balance": {
            "get": {
                "operationId": "getTrialBalance",
                "tags": [
                    "Rapporter"
                ],
                "summary": "Trial balance (saldobalans)",
                "description": "Opening balance, debit, credit and closing balance per account for the period. Debit is positive. Only posted vouchers count. Same calculation as the reports page (LedgerReports).",
                "x-sv-summary": "Saldobalans",
                "x-sv-description": "Ingående saldo, debet, kredit och utgående saldo per konto.",
                "security": [
                    {
                        "oauth2": [
                            "reports:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "reports:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "reports:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start of the period inside the fiscal year (default: its first day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End of the period inside the fiscal year (default: its last day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "cost_center",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this cost centre code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this project code.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The report.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/TrialBalance"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "from": "2026-01-01",
                                                "to": "2026-12-31",
                                                "cost_center": null,
                                                "project": null,
                                                "currency": "SEK",
                                                "rows": [
                                                    {
                                                        "account": 1930,
                                                        "name": "Företagskonto",
                                                        "opening_ore": 5000000,
                                                        "debit_ore": 125000,
                                                        "credit_ore": 40000,
                                                        "closing_ore": 5085000
                                                    },
                                                    {
                                                        "account": 3001,
                                                        "name": "Försäljning inom Sverige, 25 % moms",
                                                        "opening_ore": 0,
                                                        "debit_ore": 0,
                                                        "credit_ore": 100000,
                                                        "closing_ore": -100000
                                                    }
                                                ],
                                                "totals": {
                                                    "opening_ore": 0,
                                                    "debit_ore": 165000,
                                                    "credit_ore": 165000,
                                                    "closing_ore": 0
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/reports/general-ledger": {
            "get": {
                "operationId": "getGeneralLedger",
                "tags": [
                    "Rapporter"
                ],
                "summary": "General ledger (huvudbok)",
                "description": "Every posted row of the period per account with a running balance; with `account`, one account (kontoanalys). Debit is positive. Only posted vouchers count. Same calculation as the reports page (LedgerReports).",
                "x-sv-summary": "Huvudbok",
                "x-sv-description": "Alla bokförda rader per konto med löpande saldo; med account ett konto.",
                "security": [
                    {
                        "oauth2": [
                            "reports:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "reports:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "reports:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start of the period inside the fiscal year (default: its first day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End of the period inside the fiscal year (default: its last day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "cost_center",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this cost centre code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this project code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "account",
                        "in": "query",
                        "required": false,
                        "description": "Only this account (four digits).",
                        "schema": {
                            "type": "string",
                            "pattern": "^\\d{4}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The report.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GeneralLedger"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "from": "2026-01-01",
                                                "to": "2026-12-31",
                                                "cost_center": null,
                                                "project": null,
                                                "currency": "SEK",
                                                "accounts": [
                                                    {
                                                        "account": 1930,
                                                        "name": "Företagskonto",
                                                        "opening_ore": 5000000,
                                                        "closing_ore": 5125000,
                                                        "rows": [
                                                            {
                                                                "date": "2026-03-02",
                                                                "voucher_id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                                                "reference": "A57",
                                                                "description": "Kontantförsäljning",
                                                                "debit_ore": 125000,
                                                                "credit_ore": 0,
                                                                "balance_ore": 5125000
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/reports/balance-sheet": {
            "get": {
                "operationId": "getBalanceSheet",
                "tags": [
                    "Rapporter"
                ],
                "summary": "Balance sheet (balansrapport)",
                "description": "Assets, and equity and liabilities, grouped by BAS class, both as positive amounts, at the start and end of the period. Only posted vouchers count. Same calculation as the reports page (LedgerReports).",
                "x-sv-summary": "Balansrapport",
                "x-sv-description": "Tillgångar samt eget kapital och skulder per BAS-grupp.",
                "security": [
                    {
                        "oauth2": [
                            "reports:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "reports:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "reports:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start of the period inside the fiscal year (default: its first day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End of the period inside the fiscal year (default: its last day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "cost_center",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this cost centre code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this project code.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The report.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BalanceSheet"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "from": "2026-01-01",
                                                "to": "2026-12-31",
                                                "cost_center": null,
                                                "project": null,
                                                "currency": "SEK",
                                                "assets": {
                                                    "label": "Tillgångar",
                                                    "groups": [
                                                        {
                                                            "label": "Omsättningstillgångar",
                                                            "rows": [
                                                                {
                                                                    "account": 1930,
                                                                    "name": "Företagskonto",
                                                                    "opening_ore": 0,
                                                                    "change_ore": 85000,
                                                                    "closing_ore": 85000
                                                                }
                                                            ],
                                                            "opening_ore": 0,
                                                            "change_ore": 85000,
                                                            "closing_ore": 85000
                                                        }
                                                    ],
                                                    "opening_ore": 0,
                                                    "change_ore": 85000,
                                                    "closing_ore": 85000
                                                },
                                                "equity_and_liabilities": {
                                                    "label": "Eget kapital och skulder",
                                                    "groups": [],
                                                    "opening_ore": 0,
                                                    "change_ore": 85000,
                                                    "closing_ore": 85000
                                                },
                                                "unbooked_result": {
                                                    "opening_ore": 0,
                                                    "change_ore": 85000,
                                                    "closing_ore": 85000
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/reports/income-statement": {
            "get": {
                "operationId": "getIncomeStatement",
                "tags": [
                    "Rapporter"
                ],
                "summary": "Income statement (resultatrapport)",
                "description": "Revenue as positive and costs as negative, grouped by BAS class with subtotals; `compare=true` adds the same period one year earlier. Only posted vouchers count. Same calculation as the reports page (LedgerReports).",
                "x-sv-summary": "Resultatrapport",
                "x-sv-description": "Intäkter positiva och kostnader negativa, per BAS-grupp med delsummor; compare=true jämför med året innan.",
                "security": [
                    {
                        "oauth2": [
                            "reports:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "reports:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "reports:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Start of the period inside the fiscal year (default: its first day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "End of the period inside the fiscal year (default: its last day).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "cost_center",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this cost centre code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project",
                        "in": "query",
                        "required": false,
                        "description": "Only rows for this project code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "compare",
                        "in": "query",
                        "required": false,
                        "description": "Add the same period of the previous fiscal year.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The report.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/IncomeStatement"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "from": "2026-01-01",
                                                "to": "2026-12-31",
                                                "cost_center": null,
                                                "project": null,
                                                "currency": "SEK",
                                                "groups": [
                                                    {
                                                        "key": "revenue",
                                                        "label": "Rörelsens intäkter",
                                                        "rows": [
                                                            {
                                                                "account": 3001,
                                                                "name": "Försäljning inom Sverige, 25 % moms",
                                                                "amount_ore": 125000,
                                                                "compare_ore": null
                                                            }
                                                        ],
                                                        "total_ore": 125000,
                                                        "compare_ore": null,
                                                        "subtotal": null
                                                    }
                                                ],
                                                "result_ore": 85000,
                                                "compare_result_ore": null,
                                                "compare_period": null
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vat-periods": {
            "get": {
                "operationId": "listVatPeriods",
                "tags": [
                    "Moms"
                ],
                "summary": "List the VAT periods of a fiscal year",
                "description": "The company's VAT periods (month, quarter or year) in the fiscal year, with whether each has been settled (booked to 2650) and the amount then declared.",
                "x-sv-summary": "Lista momsperioder",
                "x-sv-description": "Företagets momsperioder i räkenskapsåret och om momsen är bokförd.",
                "security": [
                    {
                        "oauth2": [
                            "vat:prepare"
                        ]
                    },
                    {
                        "apiKey": [
                            "vat:prepare"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vat:prepare"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The periods (not paginated).",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/VatPeriod"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "start": "2026-01-01",
                                                    "end": "2026-03-31",
                                                    "label": "2026-01-01 – 2026-03-31",
                                                    "settled": true,
                                                    "settlement_voucher_id": "7c6b5a49-3827-4615-9e8d-7c6b5a493827",
                                                    "payable_sek": 250
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/vat-return": {
            "get": {
                "operationId": "getVatReturn",
                "tags": [
                    "Moms"
                ],
                "summary": "Get the VAT return of a period",
                "description": "The momsdeklaration of one period: every box in whole kronor with the accounts behind it in öre, and box 49. Calculated from the posted ledger by the same VatReturn as the app; booking the VAT and submitting the return stay in the app.",
                "x-sv-summary": "Hämta momsdeklarationen för en period",
                "x-sv-description": "Momsdeklarationens rutor i hela kronor med kontona bakom, för en period.",
                "security": [
                    {
                        "oauth2": [
                            "vat:prepare"
                        ]
                    },
                    {
                        "apiKey": [
                            "vat:prepare"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "vat:prepare"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "name": "fiscal_year_id",
                        "in": "query",
                        "required": true,
                        "description": "The fiscal year's id. Another company's id answers 404.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period_start",
                        "in": "query",
                        "required": true,
                        "description": "First day of the VAT period, as listed by /vat-periods.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The VAT return.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/VatReturn"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "fiscal_year_id": 7,
                                                "period_start": "2026-01-01",
                                                "period_end": "2026-03-31",
                                                "settled": false,
                                                "settlement_voucher_id": null,
                                                "boxes": [
                                                    {
                                                        "box": "05",
                                                        "label": "Momspliktig försäljning som inte ingår i ruta 06, 07 eller 08",
                                                        "amount_sek": 1000,
                                                        "accounts": [
                                                            {
                                                                "account": 3001,
                                                                "name": "Försäljning inom Sverige, 25 % moms",
                                                                "amount_ore": 100000
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "box": "10",
                                                        "label": "Utgående moms 25 %",
                                                        "amount_sek": 250,
                                                        "accounts": [
                                                            {
                                                                "account": 2611,
                                                                "name": "Utgående moms på försäljning inom Sverige, 25 %",
                                                                "amount_ore": 25000
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "box": "49",
                                                        "label": "Moms att betala eller få tillbaka",
                                                        "amount_sek": 250,
                                                        "accounts": []
                                                    }
                                                ],
                                                "payable_sek": 250
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/articles": {
            "get": {
                "operationId": "listArticles",
                "tags": [
                    "Artiklar"
                ],
                "summary": "List articles",
                "description": "The article register.",
                "x-sv-summary": "Lista artiklar",
                "x-sv-description": "Artikelregistret.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active (true) or inactive (false) records.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of articles.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Article"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 31,
                                                    "number": "TIM",
                                                    "name": "Konsulttimme",
                                                    "unit": "h",
                                                    "price_ore": 95000,
                                                    "currency": "SEK",
                                                    "vat_rate": 2500,
                                                    "account": 3001,
                                                    "is_active": true,
                                                    "created_at": "2026-03-02T10:45:12+01:00",
                                                    "updated_at": "2026-03-02T10:45:12+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createArticle",
                "tags": [
                    "Artiklar"
                ],
                "summary": "Create an article",
                "description": "Adds an article. Price in whole öre excluding VAT; VAT rate in basis points; the revenue account follows the VAT rate unless given. Same Action as the app (SaveArticle).",
                "x-sv-summary": "Lägg till en artikel",
                "x-sv-description": "Lägger till en artikel. Pris i öre utan moms, momssats i hundradels procent.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ArticleInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "number": "TIM",
                                        "name": "Konsulttimme",
                                        "unit": "h",
                                        "price_ore": 95000,
                                        "vat_rate": 2500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The article.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Article"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 31,
                                                "number": "TIM",
                                                "name": "Konsulttimme",
                                                "unit": "h",
                                                "price_ore": 95000,
                                                "currency": "SEK",
                                                "vat_rate": 2500,
                                                "account": 3001,
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/articles/{article}": {
            "parameters": [
                {
                    "name": "article",
                    "in": "path",
                    "required": true,
                    "description": "Article id (not the article number).",
                    "schema": {
                        "type": "integer"
                    },
                    "example": 31
                }
            ],
            "get": {
                "operationId": "getArticle",
                "tags": [
                    "Artiklar"
                ],
                "summary": "Get an article",
                "description": "One article by id.",
                "x-sv-summary": "Hämta en artikel",
                "x-sv-description": "En artikel, utifrån id.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The article.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Article"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 31,
                                                "number": "TIM",
                                                "name": "Konsulttimme",
                                                "unit": "h",
                                                "price_ore": 95000,
                                                "currency": "SEK",
                                                "vat_rate": 2500,
                                                "account": 3001,
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateArticle",
                "tags": [
                    "Artiklar"
                ],
                "summary": "Change an article",
                "description": "Changes the fields sent; the rest stay.",
                "x-sv-summary": "Ändra en artikel",
                "x-sv-description": "Ändrar de fält som skickas.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ArticlePatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "price_ore": 99500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The article.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Article"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 31,
                                                "number": "TIM",
                                                "name": "Konsulttimme",
                                                "unit": "h",
                                                "price_ore": 95000,
                                                "currency": "SEK",
                                                "vat_rate": 2500,
                                                "account": 3001,
                                                "is_active": true,
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-02T10:45:12+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices": {
            "get": {
                "operationId": "listInvoices",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "List customer invoices",
                "description": "Customer invoices and credit invoices, drafts included, with rows and payments.",
                "x-sv-summary": "Lista kundfakturor",
                "x-sv-description": "Kundfakturor och kreditfakturor med rader och betalningar.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "DRAFT, ISSUED (unpaid), PAID or CREDITED.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "DRAFT",
                                "ISSUED",
                                "PAID",
                                "CREDITED"
                            ]
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "required": false,
                        "description": "INVOICE or CREDIT.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "INVOICE",
                                "CREDIT"
                            ]
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this customer.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "From this date (YYYY-MM-DD), inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Up to this date (YYYY-MM-DD), inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of invoices.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Invoice"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                    "number": 1042,
                                                    "kind": "INVOICE",
                                                    "status": "PAID",
                                                    "credits_invoice_id": null,
                                                    "customer_id": 18,
                                                    "customer": {
                                                        "number": 1004,
                                                        "name": "Kund Exempel AB",
                                                        "org_number": "559900-4560",
                                                        "vat_number": "SE559900456001",
                                                        "email": "faktura@kund.example.se",
                                                        "address": {
                                                            "line1": "Kundvägen 5",
                                                            "line2": null,
                                                            "postal_code": "222 33",
                                                            "city": "Exempelby",
                                                            "country": "SE"
                                                        }
                                                    },
                                                    "invoice_date": "2026-03-02",
                                                    "due_date": "2026-04-01",
                                                    "delivery_date": null,
                                                    "your_reference": "Anna Exempel",
                                                    "our_reference": null,
                                                    "notes": null,
                                                    "reverse_charge": false,
                                                    "foreign_sale": null,
                                                    "tax_reduction": null,
                                                    "tax_reduction_ore": 0,
                                                    "property_designation": null,
                                                    "currency": "SEK",
                                                    "net_ore": 190000,
                                                    "vat_ore": 47500,
                                                    "rounding_ore": 0,
                                                    "total_ore": 237500,
                                                    "paid_ore": 237500,
                                                    "remaining_ore": 0,
                                                    "ocr": "104257",
                                                    "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                    "issued_at": "2026-03-02T10:45:12+01:00",
                                                    "sent_at": "2026-03-02T10:45:12+01:00",
                                                    "sent_to": "faktura@kund.example.se",
                                                    "rows": [
                                                        {
                                                            "article": "TIM",
                                                            "description": "Konsulttimme",
                                                            "quantity": "2",
                                                            "unit": "h",
                                                            "unit_price_ore": 95000,
                                                            "discount_bp": 0,
                                                            "vat_rate": 2500,
                                                            "account": 3001,
                                                            "net_ore": 190000,
                                                            "labour": false
                                                        }
                                                    ],
                                                    "payments": [
                                                        {
                                                            "id": 88,
                                                            "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                            "paid_on": "2026-03-28",
                                                            "amount_ore": 237500,
                                                            "currency": "SEK",
                                                            "account": 1930,
                                                            "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                            "created_at": "2026-03-28T09:12:00+01:00",
                                                            "updated_at": "2026-03-28T09:12:00+01:00"
                                                        }
                                                    ],
                                                    "created_at": "2026-03-02T10:45:12+01:00",
                                                    "updated_at": "2026-03-28T09:12:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Create a draft invoice",
                "description": "Creates a draft. Nothing is booked and no number is taken until it is issued. The due date follows the customer's payment terms unless given; totals, VAT and öresavrundning are calculated. Same Action as the app (SaveDraftInvoice).",
                "x-sv-summary": "Skapa ett fakturautkast",
                "x-sv-description": "Skapar ett utkast. Inget bokförs och inget nummer tas förrän fakturan skapas.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/InvoiceInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "customer_id": 18,
                                        "invoice_date": "2026-03-02",
                                        "your_reference": "Anna Exempel",
                                        "rows": [
                                            {
                                                "article": "TIM",
                                                "quantity": 2
                                            },
                                            {
                                                "description": "Resa",
                                                "quantity": "1.5",
                                                "unit_price_ore": 20000,
                                                "vat_rate": 2500,
                                                "discount_bp": 1000
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "get": {
                "operationId": "getInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Get a customer invoice",
                "description": "One invoice with rows and payments. Never a personal number.",
                "x-sv-summary": "Hämta en kundfaktura",
                "x-sv-description": "En faktura med rader och betalningar.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The invoice.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Change a draft invoice",
                "description": "Changes a draft; an issued invoice answers 403 and never changes.",
                "x-sv-summary": "Ändra ett fakturautkast",
                "x-sv-description": "Ändrar ett utkast. En skapad faktura ändras aldrig.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/InvoicePatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "your_reference": "Anna Exempel"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}/issue": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "post": {
                "operationId": "issueInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Issue (book) a draft invoice",
                "description": "Makes the draft an invoice: the next gapless invoice number, an OCR reference, the customer frozen, and under fakturametoden a voucher in series B. Irreversible; a mistake is credited. Does not e-mail it (see /send). Books a voucher as the person behind the credential, so the credential also needs vouchers:create and vouchers:post. Same Action as the app (IssueInvoice).",
                "x-sv-summary": "Skapa (bokför) fakturan",
                "x-sv-description": "Ger utkastet nummer och OCR och bokför det i serie B. Går inte att ångra, bara kreditera. Bokför en verifikation, så nyckeln eller appen behöver även vouchers:create och vouchers:post.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:send",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:send",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:send",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The issued invoice.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}/send": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "post": {
                "operationId": "sendInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "E-mail an issued invoice",
                "description": "E-mails the issued invoice as a PDF to `email` or to the customer's address, and fires invoice.sent. A test company never e-mails anything. Same Action as the app (SendInvoice).",
                "x-sv-summary": "Mejla fakturan",
                "x-sv-description": "Mejlar den skapade fakturan som PDF till kunden.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:send"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:send"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:send"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendInvoiceInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "email": "faktura@kund.example.se"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The invoice, with sent_at and sent_to.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}/credit": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "post": {
                "operationId": "creditInvoice",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Start a credit invoice",
                "description": "Creates a draft credit invoice for the whole of an unpaid invoice, with the same rows and negative quantities. It takes effect when issued with /issue, which closes both. Same Action as the app (CreditInvoice).",
                "x-sv-summary": "Kreditera en faktura",
                "x-sv-description": "Skapar ett utkast till kreditfaktura för hela den obetalda fakturan; den gäller när den skapas.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:credit"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:credit"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:credit"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "201": {
                        "description": "The credit invoice draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Invoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "number": 1042,
                                                "kind": "INVOICE",
                                                "status": "PAID",
                                                "credits_invoice_id": null,
                                                "customer_id": 18,
                                                "customer": {
                                                    "number": 1004,
                                                    "name": "Kund Exempel AB",
                                                    "org_number": "559900-4560",
                                                    "vat_number": "SE559900456001",
                                                    "email": "faktura@kund.example.se",
                                                    "address": {
                                                        "line1": "Kundvägen 5",
                                                        "line2": null,
                                                        "postal_code": "222 33",
                                                        "city": "Exempelby",
                                                        "country": "SE"
                                                    }
                                                },
                                                "invoice_date": "2026-03-02",
                                                "due_date": "2026-04-01",
                                                "delivery_date": null,
                                                "your_reference": "Anna Exempel",
                                                "our_reference": null,
                                                "notes": null,
                                                "reverse_charge": false,
                                                "foreign_sale": null,
                                                "tax_reduction": null,
                                                "tax_reduction_ore": 0,
                                                "property_designation": null,
                                                "currency": "SEK",
                                                "net_ore": 190000,
                                                "vat_ore": 47500,
                                                "rounding_ore": 0,
                                                "total_ore": 237500,
                                                "paid_ore": 237500,
                                                "remaining_ore": 0,
                                                "ocr": "104257",
                                                "voucher_id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
                                                "issued_at": "2026-03-02T10:45:12+01:00",
                                                "sent_at": "2026-03-02T10:45:12+01:00",
                                                "sent_to": "faktura@kund.example.se",
                                                "rows": [
                                                    {
                                                        "article": "TIM",
                                                        "description": "Konsulttimme",
                                                        "quantity": "2",
                                                        "unit": "h",
                                                        "unit_price_ore": 95000,
                                                        "discount_bp": 0,
                                                        "vat_rate": 2500,
                                                        "account": 3001,
                                                        "net_ore": 190000,
                                                        "labour": false
                                                    }
                                                ],
                                                "payments": [
                                                    {
                                                        "id": 88,
                                                        "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                        "paid_on": "2026-03-28",
                                                        "amount_ore": 237500,
                                                        "currency": "SEK",
                                                        "account": 1930,
                                                        "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "created_at": "2026-03-28T09:12:00+01:00",
                                                        "updated_at": "2026-03-28T09:12:00+01:00"
                                                    }
                                                ],
                                                "created_at": "2026-03-02T10:45:12+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}/payments": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "post": {
                "operationId": "registerInvoicePayment",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Register a payment",
                "description": "Registers money received, booked in series C; the invoice is PAID when nothing remains (and invoice.paid is sent). More than what remains answers 422. Books a voucher as the person behind the credential, so the credential also needs vouchers:create and vouchers:post. Same Action as the app (RegisterPayment).",
                "x-sv-summary": "Registrera en inbetalning",
                "x-sv-description": "Registrerar en inbetalning som bokförs i serie C. Bokför en verifikation, så nyckeln eller appen behöver även vouchers:create och vouchers:post.",
                "security": [
                    {
                        "oauth2": [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    },
                    {
                        "apiKey": [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PaymentInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "paid_on": "2026-03-28",
                                        "amount_ore": 237500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The payment.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/InvoicePayment"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 88,
                                                "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                "paid_on": "2026-03-28",
                                                "amount_ore": 237500,
                                                "currency": "SEK",
                                                "account": 1930,
                                                "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                "created_at": "2026-03-28T09:12:00+01:00",
                                                "updated_at": "2026-03-28T09:12:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/invoices/{invoice}/pdf": {
            "parameters": [
                {
                    "name": "invoice",
                    "in": "path",
                    "required": true,
                    "description": "Invoice id (UUID, not the invoice number).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54"
                }
            ],
            "get": {
                "operationId": "getInvoicePdf",
                "tags": [
                    "Kundfakturor"
                ],
                "summary": "Download the invoice as PDF",
                "description": "The invoice in NONOX's own layout, as a PDF (a draft is marked as one). Counts toward the company's hourly PDF quota; above it 429.",
                "x-sv-summary": "Hämta fakturan som PDF",
                "x-sv-description": "Fakturan som PDF.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The PDF.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/payments": {
            "get": {
                "operationId": "listPayments",
                "tags": [
                    "Betalningar"
                ],
                "summary": "List incoming payments",
                "description": "Money received for customer invoices, with the voucher that booked each. Read-only; a payment is registered on its invoice.",
                "x-sv-summary": "Lista inbetalningar",
                "x-sv-description": "Inbetalningar på kundfakturor med verifikationen som bokförde dem.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:view"
                        ]
                    },
                    {
                        "apiKey": [
                            "invoices:view"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "invoices:view"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Paid on or after this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Paid on or before this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of payments.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/InvoicePayment"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 88,
                                                    "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                                    "paid_on": "2026-03-28",
                                                    "amount_ore": 237500,
                                                    "currency": "SEK",
                                                    "account": 1930,
                                                    "voucher_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                                                    "created_at": "2026-03-28T09:12:00+01:00",
                                                    "updated_at": "2026-03-28T09:12:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices": {
            "get": {
                "operationId": "listSupplierInvoices",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "List supplier invoices",
                "description": "Supplier invoices and credit notes with rows, payments and payment status. Needs supplier-invoices:create, supplier-invoices:approve or payments:create.",
                "x-sv-summary": "Lista leverantörsfakturor",
                "x-sv-description": "Leverantörsfakturor med rader, betalningar och betalstatus.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "oauth2": [
                            "payments:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "payments:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ],
                        [
                            "supplier-invoices:approve"
                        ],
                        [
                            "payments:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "DRAFT, REGISTERED (waiting for approval), APPROVED (to pay) or PAID.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "DRAFT",
                                "REGISTERED",
                                "APPROVED",
                                "PAID"
                            ]
                        }
                    },
                    {
                        "name": "supplier_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this supplier.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "From this date (YYYY-MM-DD), inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Up to this date (YYYY-MM-DD), inclusive.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of supplier invoices.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SupplierInvoice"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                    "number": 77,
                                                    "kind": "INVOICE",
                                                    "status": "APPROVED",
                                                    "supplier_id": 9,
                                                    "supplier_name": "Leverantören Exempel AB",
                                                    "invoice_number": "F-2026-118",
                                                    "ocr": "4005",
                                                    "invoice_date": "2026-03-03",
                                                    "due_date": "2026-04-02",
                                                    "description": "Kontorsmaterial",
                                                    "vat_treatment": "DOMESTIC",
                                                    "currency": "SEK",
                                                    "total_ore": 125000,
                                                    "vat_ore": 25000,
                                                    "paid_ore": 0,
                                                    "remaining_ore": 125000,
                                                    "invoice_currency": "SEK",
                                                    "foreign_total_minor": null,
                                                    "foreign_paid_minor": null,
                                                    "exchange_rate_micros": null,
                                                    "file": {
                                                        "name": "faktura.pdf",
                                                        "mime": "application/pdf",
                                                        "size": 48211,
                                                        "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                    },
                                                    "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                    "registered_at": "2026-03-03T14:00:00+01:00",
                                                    "approved_at": "2026-03-04T09:30:00+01:00",
                                                    "rows": [
                                                        {
                                                            "account": 5410,
                                                            "description": "Förbrukningsinventarier",
                                                            "amount_ore": 100000,
                                                            "vat_rate": null,
                                                            "cost_center": "20",
                                                            "project": null
                                                        }
                                                    ],
                                                    "payments": [],
                                                    "created_at": "2026-03-03T13:50:00+01:00",
                                                    "updated_at": "2026-03-04T09:30:00+01:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "post": {
                "operationId": "createSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Create a draft supplier invoice",
                "description": "Saves a draft as printed on the invoice: total, VAT and cost rows, which must add up. Add the invoice file with /file. Nothing is booked until it is registered. Same Action as the app (SaveSupplierInvoice).",
                "x-sv-summary": "Skapa ett utkast till leverantörsfaktura",
                "x-sv-description": "Sparar ett utkast med belopp och konteringsrader, som måste gå jämnt ut.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SupplierInvoiceInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "supplier_id": 9,
                                        "invoice_number": "F-2026-118",
                                        "ocr": "4005",
                                        "invoice_date": "2026-03-03",
                                        "total_ore": 125000,
                                        "vat_ore": 25000,
                                        "rows": [
                                            {
                                                "account": 5410,
                                                "amount_ore": 100000,
                                                "description": "Förbrukningsinventarier",
                                                "cost_center": "20"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices/{supplierInvoice}": {
            "parameters": [
                {
                    "name": "supplierInvoice",
                    "in": "path",
                    "required": true,
                    "description": "Supplier invoice id (UUID).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e"
                }
            ],
            "get": {
                "operationId": "getSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Get a supplier invoice",
                "description": "One supplier invoice with rows, payments and payment status.",
                "x-sv-summary": "Hämta en leverantörsfaktura",
                "x-sv-description": "En leverantörsfaktura med betalstatus.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "oauth2": [
                            "payments:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "payments:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ],
                        [
                            "supplier-invoices:approve"
                        ],
                        [
                            "payments:create"
                        ]
                    ]
                },
                "responses": {
                    "200": {
                        "description": "The supplier invoice.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "patch": {
                "operationId": "updateSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Change a draft supplier invoice",
                "description": "Changes a draft; a registered invoice answers 403 and never changes.",
                "x-sv-summary": "Ändra ett utkast",
                "x-sv-description": "Ändrar ett utkast. En registrerad faktura ändras aldrig.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SupplierInvoicePatch"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "description": "Kontorsmaterial"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The draft.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            },
            "delete": {
                "operationId": "deleteSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Delete a draft supplier invoice",
                "description": "Removes a draft and its file. A registered invoice can never be removed (403).",
                "x-sv-summary": "Ta bort ett utkast",
                "x-sv-description": "Tar bort ett utkast. En registrerad faktura kan aldrig tas bort.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "responses": {
                    "204": {
                        "description": "Deleted.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices/{supplierInvoice}/file": {
            "parameters": [
                {
                    "name": "supplierInvoice",
                    "in": "path",
                    "required": true,
                    "description": "Supplier invoice id (UUID).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e"
                }
            ],
            "post": {
                "operationId": "addSupplierInvoiceFile",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Add the invoice file",
                "description": "Uploads the invoice itself to a draft as multipart/form-data in the field `file`: a PDF or an image (JPG, PNG, WebP), at most 10 MB, the type detected from the content. It becomes the underlag of the voucher when the invoice is registered. Replaces an earlier file.",
                "x-sv-summary": "Lägg till fakturafilen",
                "x-sv-description": "Laddar upp fakturan som PDF eller bild till utkastet. Den blir underlag när fakturan registreras.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The draft with its file.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices/{supplierInvoice}/register": {
            "parameters": [
                {
                    "name": "supplierInvoice",
                    "in": "path",
                    "required": true,
                    "description": "Supplier invoice id (UUID).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e"
                }
            ],
            "post": {
                "operationId": "registerSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Register a supplier invoice",
                "description": "Gives the draft the next number, freezes the supplier and under fakturametoden books it in series D with the file as underlag. From here on it never changes; it waits for approval. Books a voucher as the person behind the credential, so the credential also needs vouchers:create and vouchers:post. Same Action as the app (RegisterSupplierInvoice).",
                "x-sv-summary": "Registrera leverantörsfakturan",
                "x-sv-description": "Ger utkastet nummer och bokför det i serie D. Sedan väntar det på attest. Bokför en verifikation, så nyckeln eller appen behöver även vouchers:create och vouchers:post.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The registered invoice.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices/{supplierInvoice}/approve": {
            "parameters": [
                {
                    "name": "supplierInvoice",
                    "in": "path",
                    "required": true,
                    "description": "Supplier invoice id (UUID).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e"
                }
            ],
            "post": {
                "operationId": "approveSupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Approve (attest) a supplier invoice",
                "description": "Approves a registered invoice so it may be paid, and fires supplier_invoice.approved. Segregation of duties: while the company requires approval by someone else (the default), the person who created or registered the invoice gets 422, whichever app or key they use. Same Action as the app (ApproveSupplierInvoice).",
                "x-sv-summary": "Attestera leverantörsfakturan",
                "x-sv-description": "Attesterar fakturan. Den som registrerade den kan inte attestera den när företaget kräver attest av någon annan.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:approve"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The approved invoice.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierInvoice"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "number": 77,
                                                "kind": "INVOICE",
                                                "status": "APPROVED",
                                                "supplier_id": 9,
                                                "supplier_name": "Leverantören Exempel AB",
                                                "invoice_number": "F-2026-118",
                                                "ocr": "4005",
                                                "invoice_date": "2026-03-03",
                                                "due_date": "2026-04-02",
                                                "description": "Kontorsmaterial",
                                                "vat_treatment": "DOMESTIC",
                                                "currency": "SEK",
                                                "total_ore": 125000,
                                                "vat_ore": 25000,
                                                "paid_ore": 0,
                                                "remaining_ore": 125000,
                                                "invoice_currency": "SEK",
                                                "foreign_total_minor": null,
                                                "foreign_paid_minor": null,
                                                "exchange_rate_micros": null,
                                                "file": {
                                                    "name": "faktura.pdf",
                                                    "mime": "application/pdf",
                                                    "size": 48211,
                                                    "sha256": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d"
                                                },
                                                "voucher_id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a49382716",
                                                "registered_at": "2026-03-03T14:00:00+01:00",
                                                "approved_at": "2026-03-04T09:30:00+01:00",
                                                "rows": [
                                                    {
                                                        "account": 5410,
                                                        "description": "Förbrukningsinventarier",
                                                        "amount_ore": 100000,
                                                        "vat_rate": null,
                                                        "cost_center": "20",
                                                        "project": null
                                                    }
                                                ],
                                                "payments": [],
                                                "created_at": "2026-03-03T13:50:00+01:00",
                                                "updated_at": "2026-03-04T09:30:00+01:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-invoices/{supplierInvoice}/payments": {
            "parameters": [
                {
                    "name": "supplierInvoice",
                    "in": "path",
                    "required": true,
                    "description": "Supplier invoice id (UUID).",
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "example": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e"
                }
            ],
            "post": {
                "operationId": "paySupplierInvoice",
                "tags": [
                    "Leverantörsfakturor"
                ],
                "summary": "Register a supplier payment",
                "description": "Registers money paid for an approved invoice, booked in series E; PAID when nothing remains. For an invoice in another currency send foreign_amount_minor too; the exchange difference is booked on 3960 or 7960. Books a voucher as the person behind the credential, so the credential also needs vouchers:create and vouchers:post. Same Action as the app (PaySupplierInvoice).",
                "x-sv-summary": "Registrera en betalning",
                "x-sv-description": "Registrerar en betalning av en attesterad faktura, bokförd i serie E. Bokför en verifikation, så nyckeln eller appen behöver även vouchers:create och vouchers:post.",
                "security": [
                    {
                        "oauth2": [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    },
                    {
                        "apiKey": [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "payments:create",
                            "vouchers:create",
                            "vouchers:post"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SupplierPaymentInput"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "paid_on": "2026-03-31",
                                        "amount_ore": 125000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The payment.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            },
                            "Location": {
                                "$ref": "#/components/headers/Location"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/IdempotentReplayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SupplierPayment"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": {
                                                "id": 41,
                                                "supplier_invoice_id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                "paid_on": "2026-03-31",
                                                "amount_ore": 125000,
                                                "currency": "SEK",
                                                "foreign_amount_minor": null,
                                                "exchange_difference_ore": 0,
                                                "account": 1930,
                                                "voucher_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                                                "created_at": "2026-03-31T08:00:00+02:00",
                                                "updated_at": "2026-03-31T08:00:00+02:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "415": {
                        "$ref": "#/components/responses/UnsupportedMediaType"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/supplier-payments": {
            "get": {
                "operationId": "listSupplierPayments",
                "tags": [
                    "Betalningar"
                ],
                "summary": "List supplier payments",
                "description": "Money paid for supplier invoices, with the voucher that booked each. Read-only.",
                "x-sv-summary": "Lista utbetalningar",
                "x-sv-description": "Betalningar av leverantörsfakturor.",
                "security": [
                    {
                        "oauth2": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "oauth2": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "oauth2": [
                            "payments:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:create"
                        ]
                    },
                    {
                        "apiKey": [
                            "supplier-invoices:approve"
                        ]
                    },
                    {
                        "apiKey": [
                            "payments:create"
                        ]
                    }
                ],
                "x-required-scopes": {
                    "anyOf": [
                        [
                            "supplier-invoices:create"
                        ],
                        [
                            "supplier-invoices:approve"
                        ],
                        [
                            "payments:create"
                        ]
                    ]
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/UpdatedSince"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Paid on or after this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Paid on or before this date.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of payments.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/XRequestId"
                            },
                            "RateLimit-Limit": {
                                "$ref": "#/components/headers/RateLimitLimit"
                            },
                            "RateLimit-Remaining": {
                                "$ref": "#/components/headers/RateLimitRemaining"
                            },
                            "RateLimit-Reset": {
                                "$ref": "#/components/headers/RateLimitReset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SupplierPayment"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                },
                                "examples": {
                                    "example": {
                                        "value": {
                                            "data": [
                                                {
                                                    "id": 41,
                                                    "supplier_invoice_id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                                    "paid_on": "2026-03-31",
                                                    "amount_ore": 125000,
                                                    "currency": "SEK",
                                                    "foreign_amount_minor": null,
                                                    "exchange_difference_ore": 0,
                                                    "account": 1930,
                                                    "voucher_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                                                    "created_at": "2026-03-31T08:00:00+02:00",
                                                    "updated_at": "2026-03-31T08:00:00+02:00"
                                                }
                                            ],
                                            "meta": {
                                                "limit": 50,
                                                "next_cursor": null,
                                                "has_more": false
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        }
    },
    "webhooks": {
        "voucher.posted": {
            "post": {
                "operationId": "voucherPosted",
                "summary": "A voucher was posted",
                "x-sv-summary": "En verifikation har bokförts",
                "description": "Sent after a voucher is posted (manually, through the API, or by issuing an invoice, registering a payment and so on), once the transaction has committed, as an HTTPS POST to every active webhook of the company that subscribes to `voucher.posted`. Verify `Nonox-Signature` over the raw body before trusting it, reject a timestamp more than five minutes from your clock, and store `Nonox-Event-Id` to ignore duplicates (a delivery whose answer was lost is sent again). Answer 2xx within 10 seconds. Anything else is retried after 1, 5 and 15 minutes and 1, 3, 6 and 13 hours (eight attempts over about 23 hours); then the webhook is turned off and the company's owner is e-mailed. Redirects are never followed.",
                "x-sv-description": "Skickas med HTTPS POST till varje webhook som prenumererar på `voucher.posted`, efter att ändringen har sparats. Kontrollera Nonox-Signature, avvisa tidsstämplar äldre än fem minuter och använd Nonox-Event-Id mot dubbletter. Svara 2xx inom 10 sekunder; annars försöker NONOX igen i ungefär ett dygn och stänger sedan av webhooken.",
                "parameters": [
                    {
                        "name": "Nonox-Signature",
                        "in": "header",
                        "required": true,
                        "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the subscription secret>`. Compare in constant time.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "t=1772444713,v1=5f8e2a1c9b7d3e6f0a4c8b2d1e9f7a3c5b0d8e6f2a4c1b9d7e3f5a0c8b6d2e4f"
                    },
                    {
                        "name": "Nonox-Event-Id",
                        "in": "header",
                        "required": true,
                        "description": "Unique per event; the same on every retry.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "Nonox-Event-Type",
                        "in": "header",
                        "required": true,
                        "description": "The event type, as `type` in the body.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "voucher.posted"
                    },
                    {
                        "name": "User-Agent",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "NONOX-Webhooks/1.0 (+https://github.com/STAFE-GROUP-AB/nonox)"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "id": "c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f",
                                        "type": "voucher.posted",
                                        "created_at": "2026-03-02T10:45:13+01:00",
                                        "company_id": 42,
                                        "data": {
                                            "voucher_id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
                                            "series": "A",
                                            "number": 57,
                                            "reference": "A57",
                                            "voucher_date": "2026-03-02",
                                            "fiscal_year_id": 7,
                                            "source": "MANUAL",
                                            "amount_ore": 125000,
                                            "corrects_voucher_id": null
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Anything else, or no answer within 10 seconds (5 to connect), is retried."
                    }
                }
            }
        },
        "invoice.sent": {
            "post": {
                "operationId": "invoiceSent",
                "summary": "A customer invoice was sent",
                "x-sv-summary": "En kundfaktura har skickats",
                "description": "Sent after an issued customer invoice is e-mailed to the customer, as an HTTPS POST to every active webhook of the company that subscribes to `invoice.sent`. Verify `Nonox-Signature` over the raw body before trusting it, reject a timestamp more than five minutes from your clock, and store `Nonox-Event-Id` to ignore duplicates (a delivery whose answer was lost is sent again). Answer 2xx within 10 seconds. Anything else is retried after 1, 5 and 15 minutes and 1, 3, 6 and 13 hours (eight attempts over about 23 hours); then the webhook is turned off and the company's owner is e-mailed. Redirects are never followed.",
                "x-sv-description": "Skickas med HTTPS POST till varje webhook som prenumererar på `invoice.sent`, efter att ändringen har sparats. Kontrollera Nonox-Signature, avvisa tidsstämplar äldre än fem minuter och använd Nonox-Event-Id mot dubbletter. Svara 2xx inom 10 sekunder; annars försöker NONOX igen i ungefär ett dygn och stänger sedan av webhooken.",
                "parameters": [
                    {
                        "name": "Nonox-Signature",
                        "in": "header",
                        "required": true,
                        "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the subscription secret>`. Compare in constant time.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "t=1772444713,v1=5f8e2a1c9b7d3e6f0a4c8b2d1e9f7a3c5b0d8e6f2a4c1b9d7e3f5a0c8b6d2e4f"
                    },
                    {
                        "name": "Nonox-Event-Id",
                        "in": "header",
                        "required": true,
                        "description": "Unique per event; the same on every retry.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "Nonox-Event-Type",
                        "in": "header",
                        "required": true,
                        "description": "The event type, as `type` in the body.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "invoice.sent"
                    },
                    {
                        "name": "User-Agent",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "NONOX-Webhooks/1.0 (+https://github.com/STAFE-GROUP-AB/nonox)"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "id": "c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f",
                                        "type": "invoice.sent",
                                        "created_at": "2026-03-02T10:45:13+01:00",
                                        "company_id": 42,
                                        "data": {
                                            "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                            "invoice_number": 1042,
                                            "kind": "INVOICE",
                                            "customer_id": 18,
                                            "total_ore": 237500,
                                            "currency": "SEK",
                                            "invoice_date": "2026-03-02",
                                            "due_date": "2026-04-01",
                                            "ocr": "104257"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Anything else, or no answer within 10 seconds (5 to connect), is retried."
                    }
                }
            }
        },
        "invoice.paid": {
            "post": {
                "operationId": "invoicePaid",
                "summary": "A customer invoice was paid in full",
                "x-sv-summary": "En kundfaktura har betalats",
                "description": "Sent after a customer invoice becomes paid in full (a registered payment or a matched bank file), as an HTTPS POST to every active webhook of the company that subscribes to `invoice.paid`. Verify `Nonox-Signature` over the raw body before trusting it, reject a timestamp more than five minutes from your clock, and store `Nonox-Event-Id` to ignore duplicates (a delivery whose answer was lost is sent again). Answer 2xx within 10 seconds. Anything else is retried after 1, 5 and 15 minutes and 1, 3, 6 and 13 hours (eight attempts over about 23 hours); then the webhook is turned off and the company's owner is e-mailed. Redirects are never followed.",
                "x-sv-description": "Skickas med HTTPS POST till varje webhook som prenumererar på `invoice.paid`, efter att ändringen har sparats. Kontrollera Nonox-Signature, avvisa tidsstämplar äldre än fem minuter och använd Nonox-Event-Id mot dubbletter. Svara 2xx inom 10 sekunder; annars försöker NONOX igen i ungefär ett dygn och stänger sedan av webhooken.",
                "parameters": [
                    {
                        "name": "Nonox-Signature",
                        "in": "header",
                        "required": true,
                        "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the subscription secret>`. Compare in constant time.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "t=1772444713,v1=5f8e2a1c9b7d3e6f0a4c8b2d1e9f7a3c5b0d8e6f2a4c1b9d7e3f5a0c8b6d2e4f"
                    },
                    {
                        "name": "Nonox-Event-Id",
                        "in": "header",
                        "required": true,
                        "description": "Unique per event; the same on every retry.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "Nonox-Event-Type",
                        "in": "header",
                        "required": true,
                        "description": "The event type, as `type` in the body.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "invoice.paid"
                    },
                    {
                        "name": "User-Agent",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "NONOX-Webhooks/1.0 (+https://github.com/STAFE-GROUP-AB/nonox)"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "id": "c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f",
                                        "type": "invoice.paid",
                                        "created_at": "2026-03-02T10:45:13+01:00",
                                        "company_id": 42,
                                        "data": {
                                            "invoice_id": "5c2e8a41-7b3d-4f19-a6c2-0e9d8b7a6f54",
                                            "invoice_number": 1042,
                                            "customer_id": 18,
                                            "total_ore": 237500,
                                            "paid_ore": 237500,
                                            "currency": "SEK",
                                            "payment_id": 88,
                                            "paid_on": "2026-03-28"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Anything else, or no answer within 10 seconds (5 to connect), is retried."
                    }
                }
            }
        },
        "supplier_invoice.approved": {
            "post": {
                "operationId": "supplierInvoiceApproved",
                "summary": "A supplier invoice was approved",
                "x-sv-summary": "En leverantörsfaktura har attesterats",
                "description": "Sent after a supplier invoice is approved (attesterad), as an HTTPS POST to every active webhook of the company that subscribes to `supplier_invoice.approved`. Verify `Nonox-Signature` over the raw body before trusting it, reject a timestamp more than five minutes from your clock, and store `Nonox-Event-Id` to ignore duplicates (a delivery whose answer was lost is sent again). Answer 2xx within 10 seconds. Anything else is retried after 1, 5 and 15 minutes and 1, 3, 6 and 13 hours (eight attempts over about 23 hours); then the webhook is turned off and the company's owner is e-mailed. Redirects are never followed.",
                "x-sv-description": "Skickas med HTTPS POST till varje webhook som prenumererar på `supplier_invoice.approved`, efter att ändringen har sparats. Kontrollera Nonox-Signature, avvisa tidsstämplar äldre än fem minuter och använd Nonox-Event-Id mot dubbletter. Svara 2xx inom 10 sekunder; annars försöker NONOX igen i ungefär ett dygn och stänger sedan av webhooken.",
                "parameters": [
                    {
                        "name": "Nonox-Signature",
                        "in": "header",
                        "required": true,
                        "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the subscription secret>`. Compare in constant time.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "t=1772444713,v1=5f8e2a1c9b7d3e6f0a4c8b2d1e9f7a3c5b0d8e6f2a4c1b9d7e3f5a0c8b6d2e4f"
                    },
                    {
                        "name": "Nonox-Event-Id",
                        "in": "header",
                        "required": true,
                        "description": "Unique per event; the same on every retry.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "Nonox-Event-Type",
                        "in": "header",
                        "required": true,
                        "description": "The event type, as `type` in the body.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "supplier_invoice.approved"
                    },
                    {
                        "name": "User-Agent",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "NONOX-Webhooks/1.0 (+https://github.com/STAFE-GROUP-AB/nonox)"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            },
                            "examples": {
                                "example": {
                                    "value": {
                                        "id": "c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f",
                                        "type": "supplier_invoice.approved",
                                        "created_at": "2026-03-02T10:45:13+01:00",
                                        "company_id": 42,
                                        "data": {
                                            "supplier_invoice_id": "8d1f4b2a-3c5e-4a7b-9d0e-6f1a2b3c4d5e",
                                            "number": 77,
                                            "supplier_id": 9,
                                            "kind": "INVOICE",
                                            "total_ore": 125000,
                                            "currency": "SEK",
                                            "invoice_currency": "SEK",
                                            "due_date": "2026-04-02"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Anything else, or no answer within 10 seconds (5 to connect), is retried."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "oauth2": {
                "type": "oauth2",
                "description": "Authorization code with PKCE (S256 required). Access tokens ≤ 15 minutes; refresh tokens rotate and reuse revokes the grant.",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://nonox.app/anslut",
                        "tokenUrl": "https://nonox.app/oauth/token",
                        "refreshUrl": "https://nonox.app/oauth/token",
                        "scopes": {
                            "vouchers:view": "Read vouchers, attachments, chart of accounts, fiscal years and periods, cost centres, projects, voucher series and VAT codes",
                            "vouchers:create": "Create and change voucher drafts and add attachments",
                            "vouchers:post": "Post vouchers (irreversible; only a correction can undo the effect)",
                            "vouchers:correct": "Correct posted vouchers with a correcting voucher",
                            "accounts:manage": "Create and change cost centres and projects",
                            "reports:view": "Read the trial balance, general ledger, balance sheet and income statement",
                            "vat:prepare": "Read the VAT return per period",
                            "export:sie": "Download the bookkeeping as a SIE 4 file",
                            "invoices:view": "Read customers, articles, customer invoices and incoming payments",
                            "invoices:create": "Create and change customers, articles and draft customer invoices",
                            "invoices:send": "Issue customer invoices (with vouchers:create and vouchers:post) and e-mail them",
                            "invoices:credit": "Credit unpaid customer invoices",
                            "payments:create": "Register incoming payments and supplier payments (with vouchers:create and vouchers:post)",
                            "supplier-invoices:create": "Read suppliers and supplier invoices, create suppliers and draft and register supplier invoices",
                            "supplier-invoices:approve": "Read and approve supplier invoices (never ones the same person registered, while the company requires separate approval)"
                        },
                        "x-revocationUrl": "https://nonox.app/oauth/revoke"
                    }
                },
                "x-sv-scopes": {
                    "vouchers:view": "Läsa verifikationer, underlag, kontoplan, räkenskapsår och perioder, kostnadsställen, projekt, verifikationsserier och momskoder",
                    "vouchers:create": "Skapa och ändra utkast till verifikationer och lägga till underlag",
                    "vouchers:post": "Bokföra verifikationer (går inte att ångra, bara rätta)",
                    "vouchers:correct": "Rätta bokförda verifikationer med en rättelseverifikation",
                    "accounts:manage": "Lägga till och ändra kostnadsställen och projekt",
                    "reports:view": "Läsa saldobalans, huvudbok, balansrapport och resultatrapport",
                    "vat:prepare": "Läsa momsdeklarationen per period",
                    "export:sie": "Hämta bokföringen som en SIE 4-fil",
                    "invoices:view": "Läsa kunder, artiklar, kundfakturor och inbetalningar",
                    "invoices:create": "Lägga till och ändra kunder och artiklar och skapa utkast till kundfakturor",
                    "invoices:send": "Skapa kundfakturor (med vouchers:create och vouchers:post) och mejla dem",
                    "invoices:credit": "Kreditera obetalda kundfakturor",
                    "payments:create": "Registrera inbetalningar och betalningar till leverantörer (med vouchers:create och vouchers:post)",
                    "supplier-invoices:create": "Läsa leverantörer och leverantörsfakturor, lägga till leverantörer och skapa och registrera leverantörsfakturor",
                    "supplier-invoices:approve": "Läsa och attestera leverantörsfakturor (aldrig sådana samma person registrerat, när företaget kräver separat attest)"
                }
            },
            "apiKey": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "nnx_…",
                "description": "An API key created under Anslutningar, sent as `Authorization: Bearer nnx_…`. Its scopes are chosen when it is created."
            }
        },
        "parameters": {
            "IdempotencyKey": {
                "name": "Idempotency-Key",
                "in": "header",
                "required": true,
                "description": "Required on every POST. A unique value per intended operation (a UUID v4 is ideal), 1–255 visible ASCII characters. Kept 24 hours per credential: the same key with the same request returns the stored response (Idempotent-Replayed: true); with a different request 422 idempotency_key_reused; while the first is still running 409. Server errors (5xx) are not stored, so retry with the same key.",
                "x-sv-description": "Krävs på varje POST. Ett unikt värde per avsedd åtgärd (helst ett UUID). Sparas i 24 timmar per nyckel eller app, så att ett nytt försök aldrig bokför två gånger.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                },
                "example": "3f6c1b7e-2d4a-4e8b-9c0d-5a1b2c3d4e5f"
            },
            "Limit": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "Page size, 1–200.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "default": 50
                }
            },
            "Cursor": {
                "name": "cursor",
                "in": "query",
                "required": false,
                "description": "Opaque cursor from meta.next_cursor of the previous page.",
                "schema": {
                    "type": "string",
                    "maxLength": 2000
                }
            },
            "UpdatedSince": {
                "name": "updated_since",
                "in": "query",
                "required": false,
                "description": "Only records whose updated_at is strictly later than this ISO 8601 time. Lists are ordered by updated_at, then id, so a sync stores the updated_at of the last record it has seen and passes it next time, walking all pages with `cursor`.",
                "x-sv-description": "Bara poster som ändrats efter den här tiden (ISO 8601). Listor sorteras på updated_at och id.",
                "schema": {
                    "type": "string",
                    "format": "date-time"
                },
                "example": "2026-03-01T00:00:00+01:00"
            },
            "VoucherId": {
                "name": "voucher",
                "in": "path",
                "required": true,
                "description": "Voucher id (UUID).",
                "schema": {
                    "type": "string",
                    "format": "uuid"
                },
                "example": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e"
            }
        },
        "headers": {
            "XRequestId": {
                "description": "Unique id of this request; also in a problem's `instance`.",
                "schema": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "RateLimitLimit": {
                "description": "Requests allowed per minute for this credential.",
                "schema": {
                    "type": "integer"
                },
                "example": 120
            },
            "RateLimitRemaining": {
                "description": "Requests left in the current minute for this credential.",
                "schema": {
                    "type": "integer"
                },
                "example": 117
            },
            "RateLimitReset": {
                "description": "Seconds until the window resets.",
                "schema": {
                    "type": "integer"
                },
                "example": 42
            },
            "RetryAfter": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                    "type": "integer"
                },
                "example": 23
            },
            "IdempotentReplayed": {
                "description": "`true` when this is the stored response of an earlier request with the same Idempotency-Key (nothing was done again).",
                "schema": {
                    "type": "string",
                    "enum": [
                        "true"
                    ]
                }
            },
            "Location": {
                "description": "URL of the created resource.",
                "schema": {
                    "type": "string",
                    "format": "uri"
                }
            },
            "ContentSha256": {
                "description": "SHA-256 of the file, hex.",
                "schema": {
                    "type": "string"
                }
            },
            "WwwAuthenticate": {
                "description": "Bearer realm=\"nonox\", error=\"invalid_token\"",
                "schema": {
                    "type": "string"
                }
            }
        },
        "responses": {
            "BadRequest": {
                "description": "Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "idempotency_key_required": {
                                "summary": "No Idempotency-Key on a POST",
                                "value": {
                                    "type": "urn:nonox:problem:idempotency_key_required",
                                    "title": "Bad Request",
                                    "status": 400,
                                    "code": "idempotency_key_required",
                                    "detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            },
                            "idempotency_key_invalid": {
                                "summary": "Idempotency-Key too long or not visible ASCII",
                                "value": {
                                    "type": "urn:nonox:problem:idempotency_key_invalid",
                                    "title": "Bad Request",
                                    "status": 400,
                                    "code": "idempotency_key_invalid",
                                    "detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            },
                            "invalid_json": {
                                "summary": "Malformed JSON",
                                "value": {
                                    "type": "urn:nonox:problem:invalid_json",
                                    "title": "Bad Request",
                                    "status": 400,
                                    "code": "invalid_json",
                                    "detail": "Kroppen är inte giltig JSON (ett objekt).",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "Unauthorized": {
                "description": "Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    },
                    "WWW-Authenticate": {
                        "$ref": "#/components/headers/WwwAuthenticate"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "unauthenticated": {
                                "summary": "No valid credential",
                                "value": {
                                    "type": "urn:nonox:problem:unauthenticated",
                                    "title": "Unauthorized",
                                    "status": 401,
                                    "code": "unauthenticated",
                                    "detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "insufficient_scope": {
                                "summary": "Scope missing or permission lost",
                                "value": {
                                    "type": "urn:nonox:problem:insufficient_scope",
                                    "title": "Forbidden",
                                    "status": 403,
                                    "code": "insufficient_scope",
                                    "detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
                                    "required_scopes": [
                                        "vouchers:post"
                                    ]
                                }
                            },
                            "forbidden": {
                                "summary": "The action refuses (for example changing a posted voucher)",
                                "value": {
                                    "type": "urn:nonox:problem:forbidden",
                                    "title": "Forbidden",
                                    "status": 403,
                                    "code": "forbidden",
                                    "detail": "Behörighet saknas för det här.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            },
                            "ip_not_allowed": {
                                "summary": "Outside the IP allowlist",
                                "value": {
                                    "type": "urn:nonox:problem:ip_not_allowed",
                                    "title": "Forbidden",
                                    "status": 403,
                                    "code": "ip_not_allowed",
                                    "detail": "Företaget tillåter inte anrop från den här adressen.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            },
                            "company_archived": {
                                "summary": "Write to an archived company",
                                "value": {
                                    "type": "urn:nonox:problem:company_archived",
                                    "title": "Forbidden",
                                    "status": 403,
                                    "code": "company_archived",
                                    "detail": "Företaget är arkiverat och kan bara läsas.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            },
                            "app_not_allowed": {
                                "summary": "The company no longer allows the app",
                                "value": {
                                    "type": "urn:nonox:problem:app_not_allowed",
                                    "title": "Forbidden",
                                    "status": 403,
                                    "code": "app_not_allowed",
                                    "detail": "Företaget tillåter inte längre den här appen.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "NotFound": {
                "description": "Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "not_found": {
                                "summary": "Unknown id, other company's id, or module off",
                                "value": {
                                    "type": "urn:nonox:problem:not_found",
                                    "title": "Not Found",
                                    "status": 404,
                                    "code": "not_found",
                                    "detail": "Det du söker finns inte.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "Conflict": {
                "description": "A request with the same Idempotency-Key is still running.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/RetryAfter"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "idempotency_in_progress": {
                                "summary": "Same key, first request not finished",
                                "value": {
                                    "type": "urn:nonox:problem:idempotency_in_progress",
                                    "title": "Conflict",
                                    "status": 409,
                                    "code": "idempotency_in_progress",
                                    "detail": "En begäran med samma Idempotency-Key pågår. Vänta och försök igen.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "UnsupportedMediaType": {
                "description": "The body is not application/json (or multipart/form-data where a file is accepted).",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "unsupported_media_type": {
                                "summary": "Wrong Content-Type",
                                "value": {
                                    "type": "urn:nonox:problem:unsupported_media_type",
                                    "title": "Unsupported Media Type",
                                    "status": 415,
                                    "code": "unsupported_media_type",
                                    "detail": "Skicka JSON (application/json).",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "Unprocessable": {
                "description": "Validation failed, or the Idempotency-Key was already used for a different request.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "validation_failed": {
                                "summary": "Field errors",
                                "value": {
                                    "type": "urn:nonox:problem:validation_failed",
                                    "title": "Unprocessable Content",
                                    "status": 422,
                                    "code": "validation_failed",
                                    "detail": "Uppgifterna kunde inte godtas. Se errors.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
                                    "errors": {
                                        "rows": [
                                            "Verifikationen balanserar inte: debet och kredit skiljer sig åt."
                                        ],
                                        "voucher_date": [
                                            "Det finns inget räkenskapsår som omfattar 2031-01-01."
                                        ]
                                    }
                                }
                            },
                            "idempotency_key_reused": {
                                "summary": "Same key, different body",
                                "value": {
                                    "type": "urn:nonox:problem:idempotency_key_reused",
                                    "title": "Unprocessable Content",
                                    "status": 422,
                                    "code": "idempotency_key_reused",
                                    "detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            },
            "TooManyRequests": {
                "description": "Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/XRequestId"
                    },
                    "RateLimit-Limit": {
                        "$ref": "#/components/headers/RateLimitLimit"
                    },
                    "RateLimit-Remaining": {
                        "$ref": "#/components/headers/RateLimitRemaining"
                    },
                    "RateLimit-Reset": {
                        "$ref": "#/components/headers/RateLimitReset"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/RetryAfter"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ProblemDetails"
                        },
                        "examples": {
                            "rate_limited": {
                                "summary": "Over the limit",
                                "value": {
                                    "type": "urn:nonox:problem:rate_limited",
                                    "title": "Too Many Requests",
                                    "status": 429,
                                    "code": "rate_limited",
                                    "detail": "För många anrop. Försök igen om 23 sekunder.",
                                    "instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
                                }
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "ProblemDetails": {
                "type": "object",
                "description": "RFC 9457 problem details. `detail` is Swedish, for people; branch on `code` (or `type`), never on `detail`.",
                "required": [
                    "type",
                    "title",
                    "status",
                    "code",
                    "detail"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "format": "uri",
                        "description": "urn:nonox:problem:<code>",
                        "example": "urn:nonox:problem:not_found"
                    },
                    "title": {
                        "type": "string",
                        "description": "Short English HTTP title."
                    },
                    "status": {
                        "type": "integer"
                    },
                    "code": {
                        "type": "string",
                        "description": "Stable machine-readable code."
                    },
                    "detail": {
                        "type": "string",
                        "description": "Swedish explanation."
                    },
                    "instance": {
                        "type": "string",
                        "description": "urn:nonox:request:<uuid>, the same id as X-Request-Id; quote it in support questions."
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "description": "Validation errors per field (422 validation_failed)."
                    },
                    "required_scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Every scope the route names (403 insufficient_scope). See required_scope_sets for which combination is needed."
                    },
                    "required_scope_sets": {
                        "type": "array",
                        "items": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "description": "As x-required-scopes: any one of these sets, each needing all of its scopes (403 insufficient_scope)."
                    }
                }
            },
            "ListMeta": {
                "type": "object",
                "required": [
                    "limit",
                    "next_cursor",
                    "has_more"
                ],
                "properties": {
                    "limit": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Opaque; pass as `cursor` for the next page. null on the last page."
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Credential": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "oauth",
                            "api_key"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "App name or API key name."
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "Company": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "legal_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "legal_form": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "AB",
                            "EF",
                            "HB",
                            "KB",
                            "EK_FORENING",
                            "IDEELL_FORENING",
                            "STIFTELSE",
                            null
                        ]
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "vat_registered": {
                        "type": "boolean"
                    },
                    "vat_period": {
                        "type": "string",
                        "enum": [
                            "MONTHLY",
                            "QUARTERLY",
                            "YEARLY",
                            "NONE"
                        ]
                    },
                    "accounting_method": {
                        "type": "string",
                        "enum": [
                            "FAKTURAMETODEN",
                            "KONTANTMETODEN"
                        ]
                    },
                    "reporting_framework": {
                        "type": "string",
                        "enum": [
                            "K1",
                            "K2",
                            "K3"
                        ]
                    },
                    "fiscal_year_start_month": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                    },
                    "base_currency": {
                        "type": "string",
                        "example": "SEK"
                    },
                    "locked_until_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Postings on or before this date are refused.",
                        "format": "date"
                    },
                    "archived": {
                        "type": "boolean",
                        "description": "An archived company is read-only."
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "line1": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "line2": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "postal_code": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "country": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "ISO 3166-1 alpha-2."
                            }
                        }
                    }
                }
            },
            "CompanyWithCredential": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Company"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "credential": {
                                "$ref": "#/components/schemas/Credential"
                            }
                        }
                    }
                ]
            },
            "Account": {
                "type": "object",
                "properties": {
                    "number": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "ASSET",
                            "LIABILITY_EQUITY",
                            "REVENUE",
                            "EXPENSE"
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "sru_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "requires_cost_center": {
                        "type": "boolean"
                    },
                    "requires_project": {
                        "type": "boolean"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "VatCode": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "SALE_SE",
                            "PURCHASE_SE"
                        ]
                    },
                    "rate_basis_points": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "2500 = 25 %. null where the rate varies."
                    },
                    "vat_account": {
                        "type": "integer"
                    },
                    "report_box": {
                        "type": "integer",
                        "description": "Box on the VAT return (momsdeklaration)."
                    }
                }
            },
            "FiscalYear": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "start_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "end_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "OPEN",
                            "CLOSED"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "VoucherSeries": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "is_default": {
                        "type": "boolean"
                    }
                }
            },
            "VoucherRow": {
                "type": "object",
                "required": [
                    "account",
                    "debit_ore",
                    "credit_ore"
                ],
                "properties": {
                    "account": {
                        "type": "integer",
                        "description": "Account number.",
                        "example": 1930
                    },
                    "debit_ore": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Debit in öre."
                    },
                    "credit_ore": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Credit in öre."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Cost center code (kostnadsställe)."
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Project code."
                    }
                }
            },
            "Attachment": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "mime": {
                        "type": "string",
                        "enum": [
                            "application/pdf",
                            "image/jpeg",
                            "image/png",
                            "image/webp"
                        ]
                    },
                    "size": {
                        "type": "integer",
                        "description": "Bytes."
                    },
                    "sha256": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Voucher": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "series": {
                        "type": "string"
                    },
                    "number": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Assigned at posting; null for a draft."
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Series and number, e.g. A57; null for a draft."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "DRAFT",
                            "POSTED"
                        ]
                    },
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "voucher_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "description": {
                        "type": "string"
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "MANUAL",
                            "INVOICE",
                            "PAYMENT",
                            "SUPPLIER_INVOICE",
                            "VAT",
                            "PAYROLL",
                            "IMPORT_SIE",
                            "IMPORT_FORTNOX",
                            "CLOSING",
                            "CORRECTION"
                        ]
                    },
                    "corrects_voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "corrected_by_voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "posted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "hash": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "SHA-256 in the company's hash chain (ledger integrity)."
                    },
                    "currency": {
                        "type": "string",
                        "example": "SEK"
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/VoucherRow"
                        }
                    },
                    "attachments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Attachment"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "VoucherInput": {
                "type": "object",
                "required": [
                    "voucher_date",
                    "description",
                    "rows"
                ],
                "properties": {
                    "voucher_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "series": {
                        "type": "string",
                        "maxLength": 3,
                        "default": "A"
                    },
                    "rows": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "$ref": "#/components/schemas/VoucherRowInput"
                        }
                    }
                }
            },
            "VoucherPatch": {
                "type": "object",
                "description": "Any subset of VoucherInput. `rows` replaces all rows.",
                "properties": {
                    "voucher_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "series": {
                        "type": "string",
                        "maxLength": 3
                    },
                    "rows": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "$ref": "#/components/schemas/VoucherRowInput"
                        }
                    }
                }
            },
            "VoucherRowInput": {
                "type": "object",
                "required": [
                    "account"
                ],
                "description": "A row has either debit_ore or credit_ore above zero, never both.",
                "properties": {
                    "account": {
                        "type": "integer",
                        "description": "Account number (must exist and be active)."
                    },
                    "debit_ore": {
                        "type": "integer",
                        "minimum": 0,
                        "default": 0
                    },
                    "credit_ore": {
                        "type": "integer",
                        "minimum": 0,
                        "default": 0
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Code; required when the account requires a cost center."
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Code; required when the account requires a project."
                    }
                }
            },
            "CorrectionInput": {
                "type": "object",
                "required": [
                    "reason"
                ],
                "properties": {
                    "reason": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "Why the voucher is corrected (kept in the audit trail)."
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Date of the correcting voucher; defaults to today."
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/VoucherRowInput"
                        },
                        "description": "Rows to book instead, after the reversal."
                    }
                }
            },
            "Customer": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "number": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_personal_number": {
                        "type": "boolean",
                        "description": "Whether a personal number is on file. The number itself is never returned."
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "line1": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "line2": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "postal_code": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "country": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "ISO 3166-1 alpha-2."
                            }
                        }
                    },
                    "payment_terms_days": {
                        "type": "integer"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "reverse_charge_construction": {
                        "type": "boolean"
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "EU_GOODS",
                            "EU_SERVICES",
                            "EXPORT_GOODS",
                            "EXPORT_SERVICES",
                            "EU_TRIANGULAR",
                            "EU_CONSUMER_OSS",
                            null
                        ]
                    },
                    "processing_restricted": {
                        "type": "boolean",
                        "description": "Processing restricted under GDPR art. 18."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "CustomerInput": {
                "type": "object",
                "required": [
                    "name",
                    "payment_terms_days"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Swedish organisation number, checked with Luhn.",
                        "example": "559900-4560"
                    },
                    "personal_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Write-only. Personnummer for sole traders and private persons, checked with Luhn, stored encrypted, never returned.",
                        "writeOnly": true
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Starts with the country code.",
                        "maxLength": 20,
                        "pattern": "^[A-Z]{2}[0-9A-Z]{2,18}$"
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "address_line1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "address_line2": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Two-letter country code.",
                        "pattern": "^[A-Za-z]{2}$"
                    },
                    "payment_terms_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "reverse_charge_construction": {
                        "type": "boolean",
                        "description": "Construction services under omvänd betalningsskyldighet."
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "EU_GOODS",
                            "EU_SERVICES",
                            "EXPORT_GOODS",
                            "EXPORT_SERVICES",
                            "EU_TRIANGULAR",
                            "EU_CONSUMER_OSS",
                            null
                        ]
                    }
                }
            },
            "CustomerPatch": {
                "type": "object",
                "description": "Any subset of CustomerInput.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Swedish organisation number, checked with Luhn.",
                        "example": "559900-4560"
                    },
                    "personal_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Write-only. Personnummer for sole traders and private persons, checked with Luhn, stored encrypted, never returned.",
                        "writeOnly": true
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Starts with the country code.",
                        "maxLength": 20,
                        "pattern": "^[A-Z]{2}[0-9A-Z]{2,18}$"
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "address_line1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "address_line2": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Two-letter country code.",
                        "pattern": "^[A-Za-z]{2}$"
                    },
                    "payment_terms_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "reverse_charge_construction": {
                        "type": "boolean",
                        "description": "Construction services under omvänd betalningsskyldighet."
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "EU_GOODS",
                            "EU_SERVICES",
                            "EXPORT_GOODS",
                            "EXPORT_SERVICES",
                            "EU_TRIANGULAR",
                            "EU_CONSUMER_OSS",
                            null
                        ]
                    }
                }
            },
            "Supplier": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "number": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "line1": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "postal_code": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "country": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "bankgiro": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "plusgiro": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "iban": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "bic": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "payment_terms_days": {
                        "type": "integer"
                    },
                    "default_account": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "processing_restricted": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "SupplierInput": {
                "type": "object",
                "required": [
                    "name",
                    "payment_terms_days"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Swedish organisation number, checked with Luhn."
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20,
                        "pattern": "^[A-Z]{2}[0-9A-Z]{2,18}$"
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "address_line1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "bankgiro": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "7–8 digits with check digit, e.g. 5550-1233."
                    },
                    "plusgiro": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "2–8 digits with check digit."
                    },
                    "iban": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 42
                    },
                    "bic": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "8 or 11 characters."
                    },
                    "payment_terms_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                    },
                    "default_account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1000,
                        "maximum": 8999,
                        "description": "Default expense account number."
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "SupplierPatch": {
                "type": "object",
                "description": "Any subset of SupplierInput.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "org_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Swedish organisation number, checked with Luhn."
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20,
                        "pattern": "^[A-Z]{2}[0-9A-Z]{2,18}$"
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "address_line1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "bankgiro": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "7–8 digits with check digit, e.g. 5550-1233."
                    },
                    "plusgiro": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "2–8 digits with check digit."
                    },
                    "iban": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 42
                    },
                    "bic": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "8 or 11 characters."
                    },
                    "payment_terms_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                    },
                    "default_account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1000,
                        "maximum": 8999,
                        "description": "Default expense account number."
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "Article": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "number": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "unit": {
                        "type": "string"
                    },
                    "price_ore": {
                        "type": "integer",
                        "description": "Price excluding VAT, öre."
                    },
                    "currency": {
                        "type": "string"
                    },
                    "vat_rate": {
                        "type": "integer",
                        "description": "Basis points: 2500, 1200, 600 or 0."
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Revenue account number."
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ArticleInput": {
                "type": "object",
                "required": [
                    "number",
                    "name",
                    "unit",
                    "price_ore",
                    "vat_rate"
                ],
                "properties": {
                    "number": {
                        "type": "string",
                        "maxLength": 30
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "unit": {
                        "type": "string",
                        "maxLength": 10
                    },
                    "price_ore": {
                        "type": "integer",
                        "description": "Price excluding VAT, whole öre (an integer; decimals are refused)."
                    },
                    "vat_rate": {
                        "type": "integer",
                        "enum": [
                            2500,
                            1200,
                            600,
                            0
                        ]
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Revenue account 3000–3999; default follows the VAT rate (3001, 3002, 3003, 3004)."
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "ArticlePatch": {
                "type": "object",
                "description": "Only the fields sent are changed.",
                "properties": {
                    "number": {
                        "type": "string",
                        "maxLength": 30
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "unit": {
                        "type": "string",
                        "maxLength": 10
                    },
                    "price_ore": {
                        "type": "integer",
                        "description": "Price excluding VAT, whole öre (an integer; decimals are refused)."
                    },
                    "vat_rate": {
                        "type": "integer",
                        "enum": [
                            2500,
                            1200,
                            600,
                            0
                        ]
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Revenue account 3000–3999; default follows the VAT rate (3001, 3002, 3003, 3004)."
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "DimensionObject": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "DimensionInput": {
                "type": "object",
                "required": [
                    "code",
                    "name"
                ],
                "properties": {
                    "code": {
                        "type": "string",
                        "maxLength": 20,
                        "pattern": "^[A-Za-z0-9._-]+$",
                        "description": "Never changes once created (SIE files refer to it)."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    }
                }
            },
            "DimensionPatch": {
                "type": "object",
                "description": "The code cannot be changed; sending it answers 422.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "InvoiceRow": {
                "type": "object",
                "properties": {
                    "article": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": "string"
                    },
                    "quantity": {
                        "type": "string",
                        "description": "Decimal string, up to three decimals; negative on credit invoices."
                    },
                    "unit": {
                        "type": "string"
                    },
                    "unit_price_ore": {
                        "type": "integer"
                    },
                    "discount_bp": {
                        "type": "integer",
                        "description": "Discount in basis points (1000 is 10 %)."
                    },
                    "vat_rate": {
                        "type": "integer"
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "net_ore": {
                        "type": "integer"
                    },
                    "labour": {
                        "type": "boolean",
                        "description": "Labour cost (ROT/RUT)."
                    }
                }
            },
            "InvoicePayment": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "invoice_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "paid_on": {
                        "type": "string",
                        "format": "date"
                    },
                    "amount_ore": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bank account the money came in on."
                    },
                    "voucher_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Invoice": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "number": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Gapless invoice number, null while a draft."
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "INVOICE",
                            "CREDIT"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "DRAFT",
                            "ISSUED",
                            "PAID",
                            "CREDITED"
                        ],
                        "description": "Open enum."
                    },
                    "credits_invoice_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "customer_id": {
                        "type": "integer"
                    },
                    "customer": {
                        "type": "object",
                        "description": "The customer as on the invoice (frozen when issued). Never a personal number.",
                        "properties": {
                            "number": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "org_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "vat_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "address": {
                                "type": "object",
                                "properties": {
                                    "line1": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "line2": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "postal_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "city": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "country": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "delivery_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "your_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "our_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "reverse_charge": {
                        "type": "boolean"
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tax_reduction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "ROT or RUT."
                    },
                    "tax_reduction_ore": {
                        "type": "integer"
                    },
                    "property_designation": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "net_ore": {
                        "type": "integer"
                    },
                    "vat_ore": {
                        "type": "integer"
                    },
                    "rounding_ore": {
                        "type": "integer",
                        "description": "Öresavrundning to whole kronor."
                    },
                    "total_ore": {
                        "type": "integer"
                    },
                    "paid_ore": {
                        "type": "integer"
                    },
                    "remaining_ore": {
                        "type": "integer"
                    },
                    "ocr": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "issued_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sent_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/InvoiceRow"
                        }
                    },
                    "payments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/InvoicePayment"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "InvoiceRowInput": {
                "type": "object",
                "properties": {
                    "article": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Article number. Its name, price and VAT rate are used for fields left out."
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "quantity": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "string",
                                "pattern": "^-?\\d{1,9}(\\.\\d{1,3})?$"
                            }
                        ],
                        "description": "An integer, or a decimal string such as \"1.5\". Default 1."
                    },
                    "unit": {
                        "type": "string",
                        "maxLength": 10
                    },
                    "unit_price_ore": {
                        "type": "integer"
                    },
                    "discount_bp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000
                    },
                    "vat_rate": {
                        "type": "integer",
                        "enum": [
                            2500,
                            1200,
                            600,
                            0
                        ]
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "labour": {
                        "type": "boolean"
                    }
                }
            },
            "InvoiceInput": {
                "type": "object",
                "required": [
                    "customer_id",
                    "invoice_date",
                    "rows"
                ],
                "properties": {
                    "customer_id": {
                        "type": "integer"
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "delivery_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "your_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "our_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "reverse_charge": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tax_reduction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "ROT",
                            "RUT",
                            null
                        ]
                    },
                    "property_designation": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/InvoiceRowInput"
                        }
                    }
                }
            },
            "InvoicePatch": {
                "type": "object",
                "description": "Only the fields sent are changed; `rows`, when sent, replaces all rows.",
                "properties": {
                    "customer_id": {
                        "type": "integer"
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "delivery_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "your_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "our_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "reverse_charge": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    },
                    "foreign_sale": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tax_reduction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "ROT",
                            "RUT",
                            null
                        ]
                    },
                    "property_designation": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/InvoiceRowInput"
                        }
                    }
                }
            },
            "PaymentInput": {
                "type": "object",
                "required": [
                    "paid_on",
                    "amount_ore"
                ],
                "properties": {
                    "paid_on": {
                        "type": "string",
                        "format": "date"
                    },
                    "amount_ore": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1900,
                        "maximum": 1999,
                        "description": "Bank account; default 1930."
                    }
                }
            },
            "SendInvoiceInput": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "description": "Default: the customer's e-mail on the invoice."
                    }
                }
            },
            "SupplierInvoiceRow": {
                "type": "object",
                "properties": {
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "amount_ore": {
                        "type": "integer"
                    },
                    "vat_rate": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "SupplierPayment": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "supplier_invoice_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "paid_on": {
                        "type": "string",
                        "format": "date"
                    },
                    "amount_ore": {
                        "type": "integer",
                        "description": "Kronor the bank took, öre (negative for money back on a credit note)."
                    },
                    "currency": {
                        "type": "string"
                    },
                    "foreign_amount_minor": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Hundredths of the invoice's currency, for an invoice in another currency."
                    },
                    "exchange_difference_ore": {
                        "type": "integer"
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "voucher_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "SupplierInvoice": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "number": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "INVOICE",
                            "CREDIT"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "DRAFT",
                            "REGISTERED",
                            "APPROVED",
                            "PAID"
                        ],
                        "description": "Payment status: REGISTERED waits for approval, APPROVED waits for payment. Open enum."
                    },
                    "supplier_id": {
                        "type": "integer"
                    },
                    "supplier_name": {
                        "type": "string"
                    },
                    "invoice_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "ocr": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "vat_treatment": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "total_ore": {
                        "type": "integer"
                    },
                    "vat_ore": {
                        "type": "integer"
                    },
                    "paid_ore": {
                        "type": "integer"
                    },
                    "remaining_ore": {
                        "type": "integer"
                    },
                    "invoice_currency": {
                        "type": "string"
                    },
                    "foreign_total_minor": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "foreign_paid_minor": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "exchange_rate_micros": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Kronor per unit in millionths (9.8264 is 9826400)."
                    },
                    "file": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "mime": {
                                        "type": "string"
                                    },
                                    "size": {
                                        "type": "integer"
                                    },
                                    "sha256": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "registered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "approved_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SupplierInvoiceRow"
                        }
                    },
                    "payments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SupplierPayment"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "SupplierInvoiceInput": {
                "type": "object",
                "required": [
                    "supplier_id",
                    "invoice_date",
                    "total_ore",
                    "rows"
                ],
                "description": "The rows and the VAT must add up to total_ore.",
                "properties": {
                    "supplier_id": {
                        "type": "integer"
                    },
                    "invoice_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "ocr": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2,25}$"
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "credit": {
                        "type": "boolean",
                        "description": "A credit note; send positive amounts."
                    },
                    "vat_treatment": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "DOMESTIC",
                            "EU_GOODS",
                            "EU_SERVICES",
                            "NON_EU_SERVICES",
                            "SE_REVERSE_GOODS",
                            "SE_REVERSE_SERVICES",
                            null
                        ]
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z]{3}$"
                    },
                    "total_ore": {
                        "type": "integer",
                        "description": "To pay, in kronor (öre)."
                    },
                    "vat_ore": {
                        "type": "integer"
                    },
                    "foreign_total_minor": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "exchange_rate_micros": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "amount_ore"
                            ],
                            "properties": {
                                "account": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Default: the supplier's default account."
                                },
                                "amount_ore": {
                                    "type": "integer"
                                },
                                "description": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "vat_rate": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "cost_center": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "project": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "SupplierInvoicePatch": {
                "type": "object",
                "description": "Only the fields sent are changed; `rows`, when sent, replaces all rows.",
                "properties": {
                    "supplier_id": {
                        "type": "integer"
                    },
                    "invoice_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "ocr": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2,25}$"
                    },
                    "invoice_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "credit": {
                        "type": "boolean",
                        "description": "A credit note; send positive amounts."
                    },
                    "vat_treatment": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "DOMESTIC",
                            "EU_GOODS",
                            "EU_SERVICES",
                            "NON_EU_SERVICES",
                            "SE_REVERSE_GOODS",
                            "SE_REVERSE_SERVICES",
                            null
                        ]
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z]{3}$"
                    },
                    "total_ore": {
                        "type": "integer",
                        "description": "To pay, in kronor (öre)."
                    },
                    "vat_ore": {
                        "type": "integer"
                    },
                    "foreign_total_minor": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "exchange_rate_micros": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "amount_ore"
                            ],
                            "properties": {
                                "account": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Default: the supplier's default account."
                                },
                                "amount_ore": {
                                    "type": "integer"
                                },
                                "description": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "vat_rate": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "cost_center": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "project": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "SupplierPaymentInput": {
                "type": "object",
                "required": [
                    "paid_on",
                    "amount_ore"
                ],
                "properties": {
                    "paid_on": {
                        "type": "string",
                        "format": "date"
                    },
                    "amount_ore": {
                        "type": "integer",
                        "description": "Kronor the bank took; negative for money back on a credit note."
                    },
                    "foreign_amount_minor": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "account": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1900,
                        "maximum": 1999
                    }
                }
            },
            "TrialBalance": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "type": "string",
                        "format": "date"
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "account": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "opening_ore": {
                                    "type": "integer"
                                },
                                "debit_ore": {
                                    "type": "integer"
                                },
                                "credit_ore": {
                                    "type": "integer"
                                },
                                "closing_ore": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "totals": {
                        "type": "object",
                        "properties": {
                            "opening_ore": {
                                "type": "integer"
                            },
                            "debit_ore": {
                                "type": "integer"
                            },
                            "credit_ore": {
                                "type": "integer"
                            },
                            "closing_ore": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "GeneralLedger": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "type": "string",
                        "format": "date"
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "accounts": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "account": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "opening_ore": {
                                    "type": "integer"
                                },
                                "closing_ore": {
                                    "type": "integer"
                                },
                                "rows": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "date": {
                                                "type": "string",
                                                "format": "date"
                                            },
                                            "voucher_id": {
                                                "type": "string",
                                                "format": "uuid"
                                            },
                                            "reference": {
                                                "type": "string"
                                            },
                                            "description": {
                                                "type": "string"
                                            },
                                            "debit_ore": {
                                                "type": "integer"
                                            },
                                            "credit_ore": {
                                                "type": "integer"
                                            },
                                            "balance_ore": {
                                                "type": "integer"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "BalanceSheet": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "type": "string",
                        "format": "date"
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "assets": {
                        "type": "object",
                        "properties": {
                            "label": {
                                "type": "string"
                            },
                            "groups": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "label": {
                                            "type": "string"
                                        },
                                        "rows": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "account": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "opening_ore": {
                                                        "type": "integer"
                                                    },
                                                    "change_ore": {
                                                        "type": "integer"
                                                    },
                                                    "closing_ore": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        },
                                        "opening_ore": {
                                            "type": "integer"
                                        },
                                        "change_ore": {
                                            "type": "integer"
                                        },
                                        "closing_ore": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            },
                            "opening_ore": {
                                "type": "integer"
                            },
                            "change_ore": {
                                "type": "integer"
                            },
                            "closing_ore": {
                                "type": "integer"
                            }
                        }
                    },
                    "equity_and_liabilities": {
                        "type": "object",
                        "properties": {
                            "label": {
                                "type": "string"
                            },
                            "groups": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "label": {
                                            "type": "string"
                                        },
                                        "rows": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "account": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "opening_ore": {
                                                        "type": "integer"
                                                    },
                                                    "change_ore": {
                                                        "type": "integer"
                                                    },
                                                    "closing_ore": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        },
                                        "opening_ore": {
                                            "type": "integer"
                                        },
                                        "change_ore": {
                                            "type": "integer"
                                        },
                                        "closing_ore": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            },
                            "opening_ore": {
                                "type": "integer"
                            },
                            "change_ore": {
                                "type": "integer"
                            },
                            "closing_ore": {
                                "type": "integer"
                            }
                        }
                    },
                    "unbooked_result": {
                        "type": "object",
                        "description": "The result not yet booked to equity; included in equity_and_liabilities.",
                        "properties": {
                            "opening_ore": {
                                "type": "integer"
                            },
                            "change_ore": {
                                "type": "integer"
                            },
                            "closing_ore": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "IncomeStatement": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "type": "string",
                        "format": "date"
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "project": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "key": {
                                    "type": "string"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "rows": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "account": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            },
                                            "amount_ore": {
                                                "type": "integer"
                                            },
                                            "compare_ore": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            }
                                        }
                                    }
                                },
                                "total_ore": {
                                    "type": "integer"
                                },
                                "compare_ore": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "subtotal": {
                                    "oneOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "label": {
                                                    "type": "string"
                                                },
                                                "amount_ore": {
                                                    "type": "integer"
                                                },
                                                "compare_ore": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "result_ore": {
                        "type": "integer"
                    },
                    "compare_result_ore": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "compare_period": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "from": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "to": {
                                        "type": "string",
                                        "format": "date"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "VatPeriod": {
                "type": "object",
                "properties": {
                    "start": {
                        "type": "string",
                        "format": "date"
                    },
                    "end": {
                        "type": "string",
                        "format": "date"
                    },
                    "label": {
                        "type": "string"
                    },
                    "settled": {
                        "type": "boolean"
                    },
                    "settlement_voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "payable_sek": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Box 49 in whole kronor, when settled."
                    }
                }
            },
            "VatReturn": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "period_start": {
                        "type": "string",
                        "format": "date"
                    },
                    "period_end": {
                        "type": "string",
                        "format": "date"
                    },
                    "settled": {
                        "type": "boolean"
                    },
                    "settlement_voucher_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "boxes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "box": {
                                    "type": "string",
                                    "description": "Two digits, as on the form (05, 10, 48, 49)."
                                },
                                "label": {
                                    "type": "string"
                                },
                                "amount_sek": {
                                    "type": "integer",
                                    "description": "Whole kronor, öre dropped."
                                },
                                "accounts": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "account": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            },
                                            "amount_ore": {
                                                "type": "integer"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "payable_sek": {
                        "type": "integer",
                        "description": "Box 49: positive to pay, negative to get back."
                    }
                }
            },
            "FiscalYearPeriods": {
                "type": "object",
                "properties": {
                    "fiscal_year_id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "OPEN",
                            "CLOSED"
                        ]
                    },
                    "locked_until_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "periods": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "start": {
                                    "type": "string",
                                    "format": "date"
                                },
                                "end": {
                                    "type": "string",
                                    "format": "date"
                                },
                                "locked": {
                                    "type": "boolean",
                                    "description": "The whole month is locked: nothing can be posted in it."
                                },
                                "partly_locked": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            },
            "WebhookEvent": {
                "type": "object",
                "required": [
                    "id",
                    "type",
                    "created_at",
                    "company_id",
                    "data"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Same as the Nonox-Event-Id header; use it to ignore duplicates."
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "voucher.posted",
                            "invoice.sent",
                            "invoice.paid",
                            "supplier_invoice.approved"
                        ],
                        "description": "Open enum: new event types may be added within v1."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "company_id": {
                        "type": "integer"
                    },
                    "data": {
                        "type": "object"
                    }
                },
                "description": "A webhook delivery body. Events are thin: ids, references, dates and amounts, never personal data; fetch the record through the API for more."
            }
        }
    },
    "x-oauth": {
        "description": "OAuth 2.0 endpoints, outside /api/v1. Documented here for reference; they are not part of `paths`.",
        "x-sv-description": "OAuth-adresserna, utanför /api/v1.",
        "authorization_endpoint": {
            "method": "GET",
            "url": "https://nonox.app/anslut",
            "description": "Send the person's browser here. NONOX signs them in if needed, shows the Swedish consent screen, lets them choose a company where they are owner or administrator and approve with a passkey, then redirects to redirect_uri with `code` and `state` (or `error=access_denied`). Errors in client_id or redirect_uri are shown on the page, never redirected.",
            "query": {
                "response_type": "Must be `code`.",
                "client_id": "The app's client id (UUID).",
                "redirect_uri": "Exactly one of the app's registered URIs.",
                "scope": "Space-separated scopes.",
                "state": "Opaque value echoed back; use it against CSRF.",
                "code_challenge": "BASE64URL(SHA-256(code_verifier)).",
                "code_challenge_method": "Must be `S256`."
            }
        },
        "token_endpoint": {
            "method": "POST",
            "url": "https://nonox.app/oauth/token",
            "content_type": "application/x-www-form-urlencoded",
            "description": "grant_type=authorization_code (code, redirect_uri, code_verifier, client_id, client_secret for confidential clients) or grant_type=refresh_token (refresh_token, client_id, client_secret). Client authentication by client_secret_post or client_secret_basic; public clients send only client_id. Any other grant_type answers unsupported_grant_type. Errors follow RFC 6749 §5.2 (`error`, `error_description`). 30 requests/minute per IP.",
            "response_example": {
                "token_type": "Bearer",
                "expires_in": 900,
                "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.…",
                "refresh_token": "def50200…"
            }
        },
        "revocation_endpoint": {
            "method": "POST",
            "url": "https://nonox.app/oauth/revoke",
            "content_type": "application/x-www-form-urlencoded",
            "description": "RFC 7009. token (an access or refresh token), optional token_type_hint (access_token or refresh_token), and client authentication as at the token endpoint. A token of the app's own revokes the whole grant: every code and token, and the app must ask the person again. An unknown, expired or another app's token also answers 200 and changes nothing. Wrong client authentication answers 401 invalid_client; another hint 400 unsupported_token_type. 30 requests/minute per IP."
        },
        "metadata": {
            "method": "GET",
            "url": "https://nonox.app/.well-known/oauth-authorization-server",
            "description": "RFC 8414 authorization server metadata."
        }
    }
}
